Skip to content

Commit

Permalink
apply patch to compile on newer matlab and octave
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed May 4, 2019
1 parent bd099b9 commit d8cd440
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CPPOPT=#-g -Wall -std=c99 # -DUSE_OS_TIMER

OUTPUTFLAG:=-o
OBJSUFFIX=.o
EXESUFFIX=
EXESUFFIX=.mex*

FILES=

Expand Down
9 changes: 2 additions & 7 deletions src/zmat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@
#include "mex.h"
#include "zlib.h"

#if (! defined MX_API_VER) || (MX_API_VER < 0x07300000)
typedef int dimtype; /**< MATLAB before 2017 uses int as the dimension array */
#else
typedef size_t dimtype; /**< MATLAB after 2017 uses size_t as the dimension array */
#endif

typedef mwSize dimtype;

void zmat_usage();
int zmat_keylookup(char *origkey, const char *table[]);
Expand Down Expand Up @@ -139,7 +134,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){

while((ret=inflate(&zs, Z_SYNC_FLUSH))!=Z_STREAM_END && count<=10){
temp=(unsigned char *)realloc(temp, (buflen[0]<<count));
zs.next_out = (Bytef *)(temp+(buflen[0]<<(count-1))); //(Bytef *)(); // output char array
zs.next_out = (Bytef *)(temp+(buflen[0]<<(count-1)));
zs.avail_out = (buflen[0]<<(count-1)); // size of output
count++;
}
Expand Down

0 comments on commit d8cd440

Please sign in to comment.