Commits

BarryFSmith committed 077a9f7

fix a couple compiler warnings/errors (depending on compiler) for Matlab engine code

Comments (0)

Files changed (2)

src/mat/impls/aij/seq/matlab/aijmatlab.c

 
   PetscFunctionBegin;
   mat  = mxCreateSparse(B->cmap->n,B->rmap->n,aij->nz,mxREAL);
-  ierr = PetscMemcpy(mxGetPr(mat),aij->a,aij->nz*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemcpy(mxGetPr(mat),aij->a,aij->nz*sizeof(PetscScalar));if (ierr) return PETSC_NULL;
   /* MATLAB stores by column, not row so we pass in the transpose of the matrix */
   jj = mxGetIr(mat);
   for (i=0; i<aij->nz; i++) jj[i] = aij->j[i];

src/sys/classes/viewer/impls/socket/matlab/sopen.c

 {
   char               myname[MAXHOSTNAME+1];
   int                s;
-  PetscErrorCode     ierr;
   struct sockaddr_in sa;
   struct hostent     *hp;
 #if defined(PETSC_HAVE_UNAME)
 
   while (bind(s,(struct sockaddr*)&sa,sizeof(sa)) < 0) {
 #if defined(PETSC_HAVE_WSAGETLASTERROR)
+    PetscErrorCode     ierr;
     ierr = WSAGetLastError();
     if (ierr != WSAEADDRINUSE) {
 #else