diff --git a/Source/shared/file_util.c b/Source/shared/file_util.c index fa39feca8c..276b72952d 100644 --- a/Source/shared/file_util.c +++ b/Source/shared/file_util.c @@ -73,7 +73,7 @@ int FFLUSH(void){ /* ------------------ PRINTF ------------------------ */ -int PRINTF(const char * format, ...){ +int PRINTF(const char *format, ...){ va_list args; int return_val=0; @@ -818,7 +818,7 @@ int GetFileListSize(const char *path, char *filter, int mode){ if(dp == NULL)return 0; d_type = DT_REG; if(mode==DIR_MODE)d_type = DT_DIR; - while( (entry = readdir(dp))!=NULL ){ + while((entry = readdir(dp))!=NULL){ if(((entry->d_type==d_type||entry->d_type==DT_UNKNOWN)&&MatchWild(entry->d_name,filter)==1)){ if(strcmp(entry->d_name,".")==0||strcmp(entry->d_name,"..")==0)continue; maxfiles++; @@ -947,7 +947,7 @@ int MakeFileList(const char *path, char *filter, int maxfiles, int sort_files, f NewMemory((void **)&flist,maxfiles*sizeof(filelistdata)); d_type = DT_REG; if(mode==DIR_MODE)d_type = DT_DIR; - while( (entry = readdir(dp))!=NULL&&nfilesd_type==d_type||entry->d_type==DT_UNKNOWN)&&MatchWild(entry->d_name,filter)==1){ char *file; filelistdata *flisti; @@ -1070,12 +1070,15 @@ char *GetFloatFileSizeLabel(float size, char *sizelabel){ } #ifdef _WIN32 + +/* ------------------ GetBinPath - windows ------------------------ */ + char *GetBinPath(){ size_t MAX_BUFFER_SIZE = MAX_PATH * 20; char *buffer; size_t buffer_size = MAX_PATH * sizeof(char); NEWMEMORY(buffer, buffer_size); - for (;;){ + for(;;){ GetModuleFileNameA(NULL, buffer, buffer_size); DWORD dw = GetLastError(); if(dw == ERROR_SUCCESS){ @@ -1093,6 +1096,8 @@ char *GetBinPath(){ } } +/* ------------------ GetBinDir - windows ------------------------ */ + char *GetBinDir(){ char *buffer = GetBinPath(); // NB: This uses on older function in order to support "char *". @@ -1101,12 +1106,15 @@ char *GetBinDir(){ return buffer; } #elif __linux__ + +/* ------------------ GetBinPath - linux ------------------------ */ + char *GetBinPath(){ size_t MAX_BUFFER_SIZE = 2048 * 20; char *buffer; size_t buffer_size = 256 * sizeof(char); NEWMEMORY(buffer, buffer_size); - for (;;){ + for(;;){ int ret = readlink("/proc/self/exe", buffer, buffer_size); if(ret < buffer_size){ buffer[ret] = '\0'; @@ -1124,18 +1132,23 @@ char *GetBinPath(){ } } +/* ------------------ GetBinDir - linux ------------------------ */ + char *GetBinDir(){ char *buffer = GetBinPath(); dirname(buffer); return buffer; } #else + +/* ------------------ GetBinPath - osx ------------------------ */ + char *GetBinPath(){ uint32_t MAX_BUFFER_SIZE = 2048 * 20; char *buffer; uint32_t buffer_size = 256 * sizeof(char); NEWMEMORY(buffer, buffer_size); - for (;;){ + for(;;){ int ret = _NSGetExecutablePath(buffer, &buffer_size); if(ret == 0){ return buffer; @@ -1152,6 +1165,8 @@ char *GetBinPath(){ } } +/* ------------------ GetBinDir - osx ------------------------ */ + char *GetBinDir(){ char *buffer = GetBinPath(); // The BSD and OSX version of dirname uses an internal buffer, therefore we @@ -1168,6 +1183,8 @@ char *GetBinDir(){ /// GetSmvRootDir. char *smv_root_override = NULL; +/* ------------------ SetSmvRootOverride ------------------------ */ + void SetSmvRootOverride(const char *path){ FREEMEMORY(smv_root_override); if(path == NULL) return; @@ -1179,6 +1196,8 @@ void SetSmvRootOverride(const char *path){ } } +/* ------------------ GetSmvRootDir ------------------------ */ + char *GetSmvRootDir(){ char *envar_path = getenv("SMV_ROOT_OVERRIDE"); if(smv_root_override != NULL){ diff --git a/Source/shared/getdata.c b/Source/shared/getdata.c index db298ae023..2e00181033 100644 --- a/Source/shared/getdata.c +++ b/Source/shared/getdata.c @@ -149,7 +149,7 @@ void getzonesize(const char *zonefilename, int *nzonet, int *nrooms, rewind(file); return; } - while (1){ + while(1){ exit_all = 0; *error = fortread(&dummy, sizeof(dummy), 1, file); if(*error != 0){ @@ -159,7 +159,7 @@ void getzonesize(const char *zonefilename, int *nzonet, int *nrooms, uint32_t dummies[4]; int i; - for (i = 0; i < *nrooms; i++){ + for(i = 0; i < *nrooms; i++){ *error = fortread(dummies, sizeof(*dummies), 4, file); if(*error == 0) continue; *error = 0; @@ -169,7 +169,7 @@ void getzonesize(const char *zonefilename, int *nzonet, int *nrooms, if(exit_all == 1) break; // TODO: technically float is not fixed width here. float fdummies[2]; - for (i = 0; i < *nfires; i++){ + for(i = 0; i < *nfires; i++){ *error = fortread(fdummies, sizeof(*fdummies), 2, file); if(*error == 0) continue; *error = 0; @@ -221,7 +221,7 @@ void getpatchsizes2(FILE *file, int version, int npatch, int *npatchsize, *npatchsize = 0; int n; - for (n = 0; n < npatch; n++){ + for(n = 0; n < npatch; n++){ if(version == 0){ fortread(ijkp, sizeof(*ijkp), 6, file); } else{ @@ -443,7 +443,7 @@ void getboundaryheader2(FILE *file, int version, int npatch, int *pi1, int *pi2, uint32_t ijk[9]; int n; - for (n = 0; n < npatch; n++){ + for(n = 0; n < npatch; n++){ if(version == 0){ fortread(ijk, sizeof(*ijk), 6, file); } else{ @@ -491,7 +491,7 @@ FILE *openboundary(const char *boundaryfilename, int version, int *error){ uint32_t ijk[9] = {0}; int n; - for (n = 0; n < npatch; n++){ + for(n = 0; n < npatch; n++){ if(version == 0){ if(*error == 0){ *error = fortread(ijk, sizeof(*ijk), 6, file); @@ -536,14 +536,14 @@ void getpartheader2(FILE *file, int nclasses, int *nquantities, int *size){ *size = 0; int i; - for (i = 0; i < nclasses; i++){ + for(i = 0; i < nclasses; i++){ int t[2] = {0}; fortread(t, sizeof(*t), 2, file); nquantities[i] = t[0]; *size += 4 + 2 * nquantities[i] * (4 + 30 + 4); int j; - for (j = 0; j < nquantities[i]; j++){ + for(j = 0; j < nquantities[i]; j++){ fortread(clabel, 30, 1, file); fortread(clabel, 30, 1, file); } @@ -568,7 +568,7 @@ void getpartdataframe(FILE *file, int nclasses, int *nquantities, int *npoints, if(*error != 0) return; int i; - for (i = 0; i < nclasses; i++){ + for(i = 0; i < nclasses; i++){ *error = fortread(&nparticles, sizeof(nparticles), 1, file); if(*error != 0) return; npoints[i] = nparticles; @@ -619,11 +619,11 @@ void getzonedata(const char *zonefilename, int *nzonet, int *nrooms, ii2 = 0; int j; - for (j = 0; j < *nzonet; j++){ + for(j = 0; j < *nzonet; j++){ *error = fortread(&zonet[j], sizeof(zonet[j]), 1, file); int i; - for (i = 0; i < *nrooms; i++){ + for(i = 0; i < *nrooms; i++){ float zonevals[4]; *error = fortread(zonevals, sizeof(*zonevals), 4, file); zonepr[ii] = zonevals[0]; @@ -638,7 +638,7 @@ void getzonedata(const char *zonefilename, int *nzonet, int *nrooms, return; } } - for (i = 1; i <= *nfires; i++){ + for(i = 1; i <= *nfires; i++){ ii2 = ii2 + 1; float qdot_arr[2]; *error = fortread(&qdot_arr, sizeof(*qdot_arr), 2, file); @@ -674,7 +674,7 @@ void getpatchdata(FILE *file, int npatch, int *pi1, int *pi2, int *pj1, *npqq = 0; int i; - for (i = 0; i < npatch; i++){ + for(i = 0; i < npatch; i++){ i1 = pi1[i]; i2 = pi2[i]; j1 = pj1[i]; @@ -722,14 +722,14 @@ void getdata1(FILE *file, int *ipart, int *error){ int idummy[7]; int i; - for (i = 1; i <= nb1; i++){ + for(i = 1; i <= nb1; i++){ *error = fortread(idummy, sizeof(*idummy), 7, file); if(*error != 0) return; } *error = fortread(&nv, sizeof(nv), 1, file); if(*error != 0) return; - for (i = 1; i <= nv; i++){ + for(i = 1; i <= nv; i++){ *error = fortread(idummy, sizeof(*idummy), 7, file); if(*error != 0) return; } @@ -738,7 +738,7 @@ void getdata1(FILE *file, int *ipart, int *error){ if(*error != 0) return; float dummy[3]; - for (i = 1; i <= nspr; i++){ + for(i = 1; i <= nspr; i++){ *error = fortread(dummy, sizeof(*dummy), 3, file); if(*error != 0) return; } @@ -782,7 +782,7 @@ void writeslicedata(const char *slicefilename, int is1, int is2, int js1, nframe = nxsp * nysp * nzsp; if(redirect_flag == 0) printf("output slice data to %s\n", slicefilename); int i; - for (i = 0; i < ntimes; i++){ + for(i = 0; i < ntimes; i++){ fortwrite(times + i, sizeof(float), 1, file); fortwrite(qdata + i*nframe, sizeof(float), nframe, file); } @@ -809,15 +809,15 @@ void getsliceframe(FILE *file, int is1, int is2, int js1, int js2, int ks1, if(testslice == 2) factor = 1.1; size_t k; - for (k = 0; k < nzsp; k++){ + for(k = 0; k < nzsp; k++){ float kk = 2.0 * ((nzsp - 1) / 2.0 - k) / (nzsp - 1.0); size_t j; - for (j = 0; j < nysp; j++){ + for(j = 0; j < nysp; j++){ float jj = 2.0 * ((nysp - 1) / 2.0 - j) / (nysp - 1.0); size_t i; - for (i = 0; i < nxsp; i++){ + for(i = 0; i < nxsp; i++){ float ii = 2.0 * ((nxsp - 1) / 2.0 - i) / (nxsp - 1.0); float val = factor * (*time - 20.0) * (ii * ii + jj * jj + kk * kk) / 20.0; @@ -891,7 +891,7 @@ void outboundaryheader(const char *boundaryfilename, FILE **file, int npatches, uint32_t ijk[7] = {0}; int n; - for (n = 0; n < npatches; n++){ + for(n = 0; n < npatches; n++){ ijk[0] = pi1[n]; ijk[1] = pi2[n]; ijk[2] = pj1[n]; @@ -915,7 +915,7 @@ void outpatchframe(FILE *file, int npatch, int *pi1, int *pi2, int *pj1, ibeg = 1; int i; - for (i = 0; i < npatch; i++){ + for(i = 0; i < npatch; i++){ i1 = pi1[i]; i2 = pi2[i]; j1 = pj1[i]; @@ -976,13 +976,13 @@ void getplot3dq(const char *qfilename, int nx, int ny, int nz, float *qq, float } else{ int i; - for (i = 0; i < nx; i++){ + for(i = 0; i < nx; i++){ int j; - for (j = 0; j < ny; j++){ + for(j = 0; j < ny; j++){ int k; - for (k = 0; k < nz; k++){ + for(k = 0; k < nz; k++){ qval = pow(i - nx / 2, 2) + pow(j - ny / 2, 2) + pow(k - nz / 2, 2); qval = sqrt(qval); if(isotest == 1){ diff --git a/Source/shared/isobox.c b/Source/shared/isobox.c index 1bf9045434..ed8f782cef 100644 --- a/Source/shared/isobox.c +++ b/Source/shared/isobox.c @@ -918,7 +918,7 @@ int GetIsoSurface(isosurface *surface, /* ------------------ CompareIsoNodes ------------------------ */ -int CompareIsoNodes( const void *arg1, const void *arg2 ){ +int CompareIsoNodes(const void *arg1, const void *arg2){ sortdata *sdi, *sdj; unsigned short *vi, *vj; @@ -937,7 +937,7 @@ int CompareIsoNodes( const void *arg1, const void *arg2 ){ /* ------------------ ComputeRank ------------------------ */ -int ComputeRank( const void *arg1, const void *arg2 ){ +int ComputeRank(const void *arg1, const void *arg2){ rankdata *rdi, *rdj; int sorti, sortj; @@ -952,7 +952,7 @@ int ComputeRank( const void *arg1, const void *arg2 ){ /* ------------------ OrderClosestNodes ------------------------ */ -int OrderClosestNodes( const void *arg1, const void *arg2 ){ +int OrderClosestNodes(const void *arg1, const void *arg2){ orderdata *oi, *oj; int ii, jj; @@ -1830,7 +1830,7 @@ void CCIsoSurfaceT2File(char *isofile, float *t, float *data, int *data2flag, fl float *yplt, int *ny, float *zplt, int *nz, int *reduce_triangles, int *error - ){ + ){ isosurface surface; int i; FILE *isostream=NULL; diff --git a/Source/shared/readgeom.c b/Source/shared/readgeom.c index a4ae0e9b11..b70be39844 100644 --- a/Source/shared/readgeom.c +++ b/Source/shared/readgeom.c @@ -216,11 +216,11 @@ void GetVertType(int nverts, int *triangles, int ntriangles, int *vert_type){ memset(tri_count, 0, nverts * sizeof(*tri_count)); int i; - for (i = 0; i < ntriangles; i++){ + for(i = 0; i < ntriangles; i++){ trii = triangles + 3 * i; int j; - for (j = 0; j < 3; j++){ + for(j = 0; j < 3; j++){ int vertj_index = trii[j]; if(vertj_index >= 1 && vertj_index <= nverts) tri_count[vertj_index]++; @@ -228,7 +228,7 @@ void GetVertType(int nverts, int *triangles, int ntriangles, int *vert_type){ } int maxcount = tri_count[0]; - for (i = 1; i < nverts; i++){ + for(i = 1; i < nverts; i++){ maxcount = MAX(maxcount, tri_count[i]); } FREEMEMORY(tri_count); @@ -241,11 +241,11 @@ void GetVertType(int nverts, int *triangles, int ntriangles, int *vert_type){ NewMemory((void **)&vert_trilist, nverts * (maxcount + 1) * sizeof(int)); memset(vert_trilist, 0, nverts * (maxcount + 1) * sizeof(*vert_trilist)); - for (i = 0; i < ntriangles; i++){ + for(i = 0; i < ntriangles; i++){ trii = &triangles[3 * i]; int j; - for (j = 0; j < 3; j++){ + for(j = 0; j < 3; j++){ int vertj_index = trii[j]; if(vertj_index >= 1 && vertj_index <= nverts){ vert_trilist[vertj_index * nverts + @@ -264,21 +264,21 @@ void GetVertType(int nverts, int *triangles, int ntriangles, int *vert_type){ memset(vert_count, 0, nverts * sizeof(*vert_count)); // ! count vertices connected to each vertex - for (i = 1; i < nverts; i++){ + for(i = 1; i < nverts; i++){ memset(vert_count, 0, nverts * sizeof(*vert_count)); int j; - for (j = 1; j <= vert_trilist[i * nverts + 1]; + for(j = 1; j <= vert_trilist[i * nverts + 1]; j++){ // loop over triangles connected to vertex I int trij_index = vert_trilist[i * nverts + j]; int k; - for (k = 1; k <= 3; k++){ // loop over vertices of triangle J + for(k = 1; k <= 3; k++){ // loop over vertices of triangle J int vertk_index = triangles[3 * trij_index - 3 + k]; if(vertk_index != i) vert_count[vertk_index]++; } } - for (j = 1; j < nverts; j++){ + for(j = 1; j < nverts; j++){ if(vert_count[j] == 1){ // consider all vertices that are connected to vertex I vert_type[i] = 0; // if all of these neighbors have two neighbors among @@ -497,12 +497,12 @@ void DecimateTerrain(vertdata *verts, int nverts, tridata *triangles, *ntriangles_new = ntrinew; *triangles_new = trinewptr; - for (i = 0; i < nvnew; i++){ + for(i = 0; i < nvnew; i++){ tri_new[i] = -1; } dx = (boxmax[0] - boxmin[0]) / (float)(nx - 1); dy = (boxmax[1] - boxmin[1]) / (float)(ny - 1); - for (i = 0; i < ntriangles; i++){ + for(i = 0; i < ntriangles; i++){ tridata *trii; float *v0, *v1, *v2; float xtmin, xtmax, ytmin, ytmax; @@ -523,13 +523,13 @@ void DecimateTerrain(vertdata *verts, int nverts, tridata *triangles, imax = CLAMP((xtmax - boxmin[0]) / dx + 1, 0, nx - 1); jmin = CLAMP((ytmin - boxmin[1]) / dy, 0, ny - 1); jmax = CLAMP((ytmax - boxmin[1]) / dy + 1, 0, ny - 1); - for (ii = imin; ii <= imax; ii++){ + for(ii = imin; ii <= imax; ii++){ int jj, exit_loop; xyz[0] = boxmin[0] + (float)ii * dx; exit_loop = 0; - for (jj = jmin; jj <= jmax; jj++){ + for(jj = jmin; jj <= jmax; jj++){ float zval; xyz[1] = boxmin[1] + (float)jj * dy; @@ -550,8 +550,8 @@ void DecimateTerrain(vertdata *verts, int nverts, tridata *triangles, } int ij = 0; int ncount2 = 0; - for (j = 0; j < ny - 1; j++){ - for (i = 0; i < nx - 1; i++){ + for(j = 0; j < ny - 1; j++){ + for(i = 0; i < nx - 1; i++){ tridata *tri; int ival; @@ -587,13 +587,13 @@ void DecimateTerrain(vertdata *verts, int nverts, tridata *triangles, void DecimateAllTerrains(void){ int i; - for (i = 0; i < nmeshes; i++){ + for(i = 0; i < nmeshes; i++){ meshdata *meshi; meshi = meshinfo + i; meshi->decimated = 0; } - for (i = 0; i < npatchinfo; i++){ + for(i = 0; i < npatchinfo; i++){ meshdata *meshi; patchdata *patchi; geomlistdata *geomlisti; @@ -631,7 +631,7 @@ void GetTriangleNormal(float *v1, float *v2, float *v3, float *normal, float norm; int i; - for (i = 0; i < 3; i++){ + for(i = 0; i < 3; i++){ u[i] = (double)v2[i] - (double)v1[i]; v[i] = (double)v3[i] - (double)v1[i]; } @@ -949,7 +949,7 @@ void ReadGeomHeader2(geomdata *geomi, int *ntimes_local){ nt = 0; if(first_frame_all == 1) nt = -1; - for (;;){ + for(;;){ FORTREADBR(&time_local, 1, stream); FORTREADBR(nvertfacesvolumes, 3, stream); nverts = nvertfacesvolumes[0]; @@ -1040,7 +1040,7 @@ void GetGeomDataHeader(char *file, int *ntimes_local, int *nvals){ FSEEK(stream, 4, SEEK_CUR); nt = -1; nv = 0; - for (;;){ + for(;;){ FORTREADBR(&time_local, 1, stream); FORTREADBR(&nface_static, 1, stream); if(nface_static != 0) FSEEK(stream, 4 + nface_static * 4 + 4, SEEK_CUR); @@ -1077,7 +1077,7 @@ void InitCircle(unsigned int npoints, circdata *circinfo){ NewMemory((void **)&ycirc, (ncirc + 1) * sizeof(float)); drad = 2.0 * PI / (float)ncirc; - for (i = 0; i < ncirc; i++){ + for(i = 0; i < ncirc; i++){ xcirc[i] = cos(i * drad); ycirc[i] = sin(i * drad); } diff --git a/Source/shared/readobject.c b/Source/shared/readobject.c index f1b93af77e..7f6d577ffa 100644 --- a/Source/shared/readobject.c +++ b/Source/shared/readobject.c @@ -56,7 +56,7 @@ void FreeObject(sv_object *object){ frame_start = &object->first_frame; framei = frame_start->next; - for (; framei->next != NULL;){ + for(; framei->next != NULL;){ sv_object_frame *next_frame; next_frame = framei->next; @@ -104,7 +104,7 @@ sv_object *GetSmvObjectType(object_collection *objectscoll, char *olabel, TrimBack(label); labelptr = TrimFront(label); if(strlen(labelptr) == 0) return default_object; - for (i = 0; i < objectscoll->nobject_defs; i++){ + for(i = 0; i < objectscoll->nobject_defs; i++){ objecti = objectscoll->object_defs[i]; if(STRCMP(labelptr, objecti->label) == 0){ objecti->used = 1; @@ -128,7 +128,7 @@ sv_object *GetSmvObjectType2(object_collection *objectscoll, char *olabel, if(strlen(labelptr) == 0) return default_object; object_start = objectscoll->object_def_first.next; objecti = object_start; - for (; objecti->next != NULL;){ + for(; objecti->next != NULL;){ if(STRCMP(labelptr, objecti->label) == 0){ objecti->used = 1; return objecti; @@ -152,7 +152,7 @@ void ParseSmvObjectString(object_collection *objectscoll, char *string, in_token = 0; last_in_token = 0; len = strlen(string); - for (i = 0; i <= len; i++){ + for(i = 0; i <= len; i++){ switch(*c){ case '"': in_quote = 1 - in_quote; @@ -232,12 +232,12 @@ void ParseSmvObjectString(object_collection *objectscoll, char *string, nparms = 2; } ntail -= nparms; - for (j = 0, frame = included_object->first_frame.next; + for(j = 0, frame = included_object->first_frame.next; frame->next != NULL; j++, frame = frame->next){ if(j == iframe_local) break; } in_head2 = 1; - for (j = 0; j < frame->ntokens; j++){ + for(j = 0; j < frame->ntokens; j++){ char *cc; cc = frame->tokens[j].tokenlabel; @@ -255,10 +255,10 @@ void ParseSmvObjectString(object_collection *objectscoll, char *string, c++; } ntok2 = 0; - for (i = 0; i < nhead; i++){ + for(i = 0; i < nhead; i++){ tokens[ntok2++] = tokens_head[i]; } - for (i = 0; i < ntail; i++){ + for(i = 0; i < ntail; i++){ tokens[ntok2++] = tokens_tail[i]; } *ntokens = ntok2; @@ -274,7 +274,7 @@ void GetIndepVarIndices(sv_object *smv_object, char **var_indep_strings, obj_frame = smv_object->obj_frames[0]; - for (i = 0; i < nvars_indep; i++){ + for(i = 0; i < nvars_indep; i++){ char *var; var = var_indep_strings[i]; @@ -304,7 +304,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, frame->error = 0; TrimBack(buffer); strcpy(object_buffer, buffer); - while (stream != NULL && !feof(stream)){ + while(stream != NULL && !feof(stream)){ if(fgets(buffer, 255, stream) == NULL){ *eof = 1; break; @@ -330,7 +330,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, nsymbols = 0; ncommands = 0; - for (i = 0; i < ntokens; i++){ + for(i = 0; i < ntokens; i++){ tokendata *toki; char c; token = tokens[i]; @@ -354,7 +354,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, nsymbols = 0; ncommands = 0; - for (i = 0; i < ntokens; i++){ + for(i = 0; i < ntokens; i++){ tokendata *toki, *first_token = NULL; char c; @@ -417,7 +417,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, int ii; noutargs_actual = 0; - for (ii = 0; ii < nargs_actual; ii++){ + for(ii = 0; ii < nargs_actual; ii++){ tokendata *tokii; tokii = toki - 1 - ii; @@ -544,7 +544,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, } } frame->ntextures = ntextures_local; - for (i = 0; i < ntokens; i++){ + for(i = 0; i < ntokens; i++){ tokendata *toki; char c; @@ -555,7 +555,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, // define data structures for conditional tokens - for (i = 0; i < ncommands; i++){ + for(i = 0; i < ncommands; i++){ tokendata *toki; toki = frame->command_list[i]; @@ -564,7 +564,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, case SV_IF: if_level = 0; - for (j = i + 1; j < ncommands; j++){ + for(j = i + 1; j < ncommands; j++){ tokendata *tokj; tokj = frame->command_list[j]; @@ -585,7 +585,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in, break; case SV_ELSE: if_level = 0; - for (j = i + 1; j < ncommands; j++){ + for(j = i + 1; j < ncommands; j++){ tokendata *tokj; tokj = frame->command_list[j]; @@ -1064,7 +1064,7 @@ int GetTokenId(char *token, int *opptr, int *num_opptr, int *num_outopptr, int GetObjectFrameTokenLoc(char *var, sv_object_frame *frame){ int i; - for (i = 0; i < frame->nsymbols; i++){ + for(i = 0; i < frame->nsymbols; i++){ int ii; tokendata *toki; char *token_var; @@ -1096,7 +1096,7 @@ sv_object *InitSmvObject2(object_collection *objectscoll, const char *label, NewMemory((void **)&object->obj_frames, object->nframes * sizeof(sv_object_frame *)); - for (i = 0; i < object->nframes; i++){ + for(i = 0; i < object->nframes; i++){ sv_object_frame *framei; int eof; @@ -1159,7 +1159,7 @@ sv_object *InitSmvObject1(object_collection *objectscoll, const char *label, void FreeObjectCollection(object_collection *objectscoll){ sv_object *object; - for (;;){ + for(;;){ object = objectscoll->object_def_last.prev; if(object->prev == NULL) break; FreeObject(object); @@ -1174,7 +1174,7 @@ sv_object *GetSmvObject(object_collection *objectscoll, char *label){ object_start = objectscoll->object_def_first.next; objecti = object_start; - for (; objecti->next != NULL; objecti = objecti->next){ + for(; objecti->next != NULL; objecti = objecti->next){ if(STRCMP(objecti->label, label) == 0) return objecti; } return NULL; @@ -1201,7 +1201,7 @@ int ReadObjectDefs(object_collection *objectscoll, const char *file, firstdef = -1; buffer_ptr = NULL; - while (!feof(stream)){ + while(!feof(stream)){ CheckMemory; if(buffer_ptr == NULL){ if(eof == 1 || fgets(buffer, 255, stream) == NULL) break; @@ -1299,7 +1299,7 @@ int ReadObjectDefs(object_collection *objectscoll, const char *file, object_start = objectscoll->object_def_first.next; objecti = object_start; objectscoll->nobject_defs = 0; - for (; objecti->next != NULL;){ + for(; objecti->next != NULL;){ CheckMemory; (objectscoll->nobject_defs)++; objecti->obj_frames = NULL; @@ -1319,7 +1319,7 @@ int ReadObjectDefs(object_collection *objectscoll, const char *file, object_start = objectscoll->object_def_first.next; objecti = object_start; i = 0; - for (; objecti->next != NULL;){ + for(; objecti->next != NULL;){ sv_object_frame *frame_start, *framei; CheckMemory; @@ -1328,12 +1328,12 @@ int ReadObjectDefs(object_collection *objectscoll, const char *file, frame_start = objecti->first_frame.next; framei = frame_start; j = 0; - for (; framei->next != NULL;){ + for(; framei->next != NULL;){ int npushpop = 0, ii; CheckMemory; objecti->obj_frames[j] = framei; - for (ii = 0; ii < framei->ncommands; ii++){ + for(ii = 0; ii < framei->ncommands; ii++){ tokendata *command; int op; @@ -1383,7 +1383,7 @@ void InitAvatar(object_collection *objectscoll, int setbw){ object_start = objectscoll->object_def_first.next; objectscoll->navatar_types = 2; - for (objecti = object_start; objecti->next != NULL; objecti = objecti->next){ + for(objecti = object_start; objecti->next != NULL; objecti = objecti->next){ if(objecti->type == IS_AVATAR) objectscoll->navatar_types++; } NewMemory((void **)&objectscoll->avatar_types, @@ -1406,7 +1406,7 @@ void InitAvatar(object_collection *objectscoll, int setbw){ objectscoll->avatar_types[1] = objectscoll->avatar_defs_backup[1]; iavatar_types_local = 2; - for (objecti = object_start; objecti->next != NULL; objecti = objecti->next){ + for(objecti = object_start; objecti->next != NULL; objecti = objecti->next){ if(objecti->type == IS_NOT_AVATAR) continue; objectscoll->avatar_types[iavatar_types_local++] = objecti; } @@ -1557,7 +1557,7 @@ void UpdateDeviceTextures(object_collection *objectscoll, int ndeviceinfo, char **device_texture_list=NULL; int *device_texture_list_index=NULL; - for (i = 0; i < ndeviceinfo; i++){ + for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; devicei = deviceinfo + i; @@ -1571,21 +1571,21 @@ void UpdateDeviceTextures(object_collection *objectscoll, int ndeviceinfo, // count device textures - for (i = 0; i < ndeviceinfo; i++){ + for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; sv_object *object; int j; devicei = deviceinfo + i; object = devicei->object; - for (j = 0; j < object->nframes; j++){ + for(j = 0; j < object->nframes; j++){ sv_object_frame *frame; frame = object->obj_frames[j]; ndevice_texture_list += frame->ntextures; } } - for (i = 0; i < npropinfo; i++){ + for(i = 0; i < npropinfo; i++){ propdata *propi; propi = propinfo + i; @@ -1601,20 +1601,20 @@ void UpdateDeviceTextures(object_collection *objectscoll, int ndeviceinfo, NewMemory((void **)&device_texture_list_index, ndevice_texture_list * sizeof(int)); ndevice_texture_list = 0; - for (i = 0; i < ndeviceinfo; i++){ + for(i = 0; i < ndeviceinfo; i++){ devicedata *devicei; sv_object *object; int j; devicei = deviceinfo + i; object = devicei->object; - for (j = 0; j < object->nframes; j++){ + for(j = 0; j < object->nframes; j++){ sv_object_frame *frame; int k; frame = object->obj_frames[j]; if(frame->ntextures == 0) continue; - for (k = 0; k < frame->ntokens; k++){ + for(k = 0; k < frame->ntokens; k++){ tokendata *toki; int kk; int dup; @@ -1622,7 +1622,7 @@ void UpdateDeviceTextures(object_collection *objectscoll, int ndeviceinfo, toki = frame->tokens + k; if(toki->type != TOKEN_TEXTURE) continue; dup = 0; - for (kk = 0; kk < ndevice_texture_list; kk++){ + for(kk = 0; kk < ndevice_texture_list; kk++){ if(strcmp(device_texture_list[kk], toki->string) == 0){ dup = 1; break; @@ -1633,20 +1633,20 @@ void UpdateDeviceTextures(object_collection *objectscoll, int ndeviceinfo, } } } - for (i = 0; i < npropinfo; i++){ + for(i = 0; i < npropinfo; i++){ propdata *propi; int j; propi = propinfo + i; if(propi->ntextures == 0) continue; - for (j = 0; j < propi->ntextures; j++){ + for(j = 0; j < propi->ntextures; j++){ int dup; char *texturefile; int kk; texturefile = propi->texturefiles[j]; dup = 0; - for (kk = 0; kk < ndevice_texture_list; kk++){ + for(kk = 0; kk < ndevice_texture_list; kk++){ if(strcmp(device_texture_list[kk], texturefile) == 0){ dup = 1; break; diff --git a/Source/shared/stdio_m.h b/Source/shared/stdio_m.h index d4d6f17d64..00859d7a2d 100644 --- a/Source/shared/stdio_m.h +++ b/Source/shared/stdio_m.h @@ -23,7 +23,7 @@ typedef struct { void fclose_b(FILE_m *stream_m); void fclose_m(FILE_m *stream_m); -char *fgets_m(char * str, int num, FILE_m *stream_m); +char *fgets_m(char *str, int num, FILE_m *stream_m); int feof_m(FILE_m *stream_m); FILE_m *fopen_m(char *file, char *mode); FILE_m *fopen_b(char *file, unsigned char *buffer, size_t nbuffer, char *mode); diff --git a/Source/shared/string_util.c b/Source/shared/string_util.c index b9727a6d48..f44ea64ce9 100644 --- a/Source/shared/string_util.c +++ b/Source/shared/string_util.c @@ -405,7 +405,7 @@ int STRCMP(const char *s1, const char *s2){ // same as the standard function, strcmp, but ignores case - while (toupper(*s1) == toupper(*s2++)){ + while(toupper(*s1) == toupper(*s2++)){ if(*s1++ == 0)return (0); } return (toupper(*(const unsigned char *)s1) - toupper(*(const unsigned char *)(s2 - 1))); @@ -957,7 +957,7 @@ int LogBase2(float xx){ unsigned int x; x=xx; - while( (x >> r) != 0){ + while((x >> r) != 0){ r++; } return r-1; // returns -1 for x==0, floor(log2(x)) otherwise diff --git a/Source/shared/translate.c b/Source/shared/translate.c index 08ec4bf91a..0242fea2c3 100644 --- a/Source/shared/translate.c +++ b/Source/shared/translate.c @@ -10,7 +10,7 @@ /* ------------------ CompareTrdata ------------------------ */ -int CompareTrdata( const void *arg1, const void *arg2 ){ +int CompareTrdata(const void *arg1, const void *arg2){ trdata *tri, *trj; tri = (trdata *)arg1; diff --git a/Source/shared/translate.h b/Source/shared/translate.h index 131867a049..0215baf6d0 100644 --- a/Source/shared/translate.h +++ b/Source/shared/translate.h @@ -19,7 +19,7 @@ typedef struct { //************************** headers **************************************** -TREXTERN int CompareTrdata( const void *arg1, const void *arg2 ); +TREXTERN int CompareTrdata(const void *arg1, const void *arg2 ); TREXTERN char *Translate(char *string); TREXTERN void InitTranslate(char *bindir, char *tr_name); TREXTERN int ParseLang(char *file, trdata **trinfoptr, int *ntrinfoptr); diff --git a/Source/smokeview/IOboundary.c b/Source/smokeview/IOboundary.c index 2f133a53f2..fbfe5fe442 100644 --- a/Source/smokeview/IOboundary.c +++ b/Source/smokeview/IOboundary.c @@ -1064,7 +1064,7 @@ void GetBoundaryDataZlib(patchdata *patchi, unsigned char *data, int ndata, buffer = patchi->frameinfo->bufferinfo->buffer; nbuffer = patchi->frameinfo->bufferinfo->nbuffer; } - stream = fopen_b(( char * )patchi->file, buffer, nbuffer, "rb"); + stream = fopen_b((char *)patchi->file, buffer, nbuffer, "rb"); #else stream = fopen_m((char *)patchi->file, "rb"); #endif @@ -1397,7 +1397,7 @@ int GetPatchNTimes(char *file){ int count = 0; char buffer[255]; - for (;;){ + for(;;){ if(fgets(buffer, 255, stream) == NULL) break; count++; @@ -1418,7 +1418,7 @@ void GetPatchSizes1(FILE_m **stream, const char *patchfilename, unsigned char *b return; } #ifdef pp_BOUNDFRAME - *stream = fopen_b(( char * )patchfilename, buffer, nbuffer, "rb"); + *stream = fopen_b((char *)patchfilename, buffer, nbuffer, "rb"); #else *stream = fopen_m((char *)patchfilename, "rb"); #endif @@ -1449,7 +1449,7 @@ void GetPatchSizes2(FILE_m *stream, int version, int npatch, int *npatchsize, *npatchsize = 0; int n; - for (n = 0; n < npatch; n++){ + for(n = 0; n < npatch; n++){ if(version == 0){ fseek_m(stream, 4, SEEK_CUR);fread_m(ijkp, sizeof(*ijkp), 6, stream);fseek_m(stream, 4, SEEK_CUR); } @@ -2897,7 +2897,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ xyzpatchcopy = xyzpatch + 3*blockstart[n]; patchblankcopy = patchblank + blockstart[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe + blockstart[n]; #endif @@ -2993,7 +2993,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ xyzpatchcopy = xyzpatch + 3*blockstart[n]; patchblankcopy = patchblank + blockstart[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else if(patchi->compression_type != COMPRESSED_ZLIB)patchvals = patchval_iframe+blockstart[n]; @@ -3106,7 +3106,7 @@ void DrawBoundaryTexture(const meshdata *meshi){ xyzpatchcopy = xyzpatch + 3*blockstart[n]; patchblankcopy = patchblank + blockstart[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else if(patchi->compression_type != COMPRESSED_ZLIB)patchvals = patchval_iframe+blockstart[n]; #endif @@ -3286,7 +3286,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ patchblankcopy = patchblank + blockstart[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe + blockstart[n]; #endif @@ -3376,7 +3376,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ xyzpatchcopy = xyzpatch + 3*blockstart[n]; patchblankcopy = patchblank + blockstart[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe + blockstart[n]; #endif @@ -3463,7 +3463,7 @@ void DrawBoundaryTextureThreshold(const meshdata *meshi){ xyzpatchcopy = xyzpatch + 3*blockstart[n]; patchblankcopy = patchblank + blockstart[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe + blockstart[n]; #endif @@ -3865,7 +3865,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ nrow = boundary_row[n]; ncol = boundary_col[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe+blockstart[n]; #endif @@ -3950,7 +3950,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ nrow = boundary_row[n]; ncol = boundary_col[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe+blockstart[n]; #endif @@ -4053,7 +4053,7 @@ void DrawBoundaryCellCenter(const meshdata *meshi){ nrow = boundary_row[n]; ncol = boundary_col[n]; #ifdef pp_BOUNDFRAME - patchvals = ( float * )FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); + patchvals = (float *)FRAMEGetSubFramePtr(patchi->frameinfo, meshi->patch_itime, n); #else patchvals = patchval_iframe+blockstart[n]; #endif @@ -4255,7 +4255,7 @@ void UpdateBoundaryType(void){ /* ------------------ BoundaryCompare ------------------------ */ -int BoundaryCompare( const void *arg1, const void *arg2 ){ +int BoundaryCompare(const void *arg1, const void *arg2){ patchdata *patchi, *patchj; patchi = patchinfo + *(int *)arg1; diff --git a/Source/smokeview/IOgeometry.c b/Source/smokeview/IOgeometry.c index 8aa1e7ab36..2bf24935df 100644 --- a/Source/smokeview/IOgeometry.c +++ b/Source/smokeview/IOgeometry.c @@ -2201,7 +2201,7 @@ FILE_SIZE ReadGeomData(patchdata *patchi, slicedata *slicei, int load_flag, int if(slicei == NULL){ if(colorlabelpatch != NULL){ - for (n = 0; n < MAXRGB; n++){ + for(n = 0; n < MAXRGB; n++){ FREEMEMORY(colorlabelpatch[n]); } FREEMEMORY(colorlabelpatch); @@ -2210,10 +2210,10 @@ FILE_SIZE ReadGeomData(patchdata *patchi, slicedata *slicei, int load_flag, int ReadGeomData(patchi, NULL, UNLOAD, time_frame, time_value, 0, &error); return 0; } - for (n = 0; n < MAXRGB; n++){ + for(n = 0; n < MAXRGB; n++){ colorlabelpatch[n] = NULL; } - for (n = 0; n < nrgb; n++){ + for(n = 0; n < nrgb; n++){ if(NewMemory((void **)&colorlabelpatch[n], 11) == 0){ ReadGeomData(patchi, NULL, UNLOAD, time_frame, time_value, 0, &error); return 0; @@ -2267,7 +2267,7 @@ FILE_SIZE ReadGeomData(patchdata *patchi, slicedata *slicei, int load_flag, int ntimes = patchi->ngeom_times; data_per_timestep = nvals2/ntimes; #ifdef pp_SLICEFRAME - qvalptrs = ( float ** )slicei->frameinfo->frameptrs; + qvalptrs = (float **)slicei->frameinfo->frameptrs; #else NewMemory((void **)&qvalptrs, ntimes*sizeof(float *)); for(i = 0; i < ntimes; i++){ @@ -2282,7 +2282,7 @@ FILE_SIZE ReadGeomData(patchdata *patchi, slicedata *slicei, int load_flag, int slicei->valmax_slice = qmax; slicei->globalmin_slice = qmin; slicei->globalmax_slice = qmax; - for (i = 0; i < 256; i++){ + for(i = 0; i < 256; i++){ slicei->qval256[i] = (qmin*(255 - i) + qmax*i) / 255; } UpdateSliceBounds(); diff --git a/Source/smokeview/IOhvac.c b/Source/smokeview/IOhvac.c index c620475b03..dad007474b 100644 --- a/Source/smokeview/IOhvac.c +++ b/Source/smokeview/IOhvac.c @@ -466,13 +466,13 @@ void ReadHVACData(int flag){ STOP_TIMER(total_time); PRINTF("Loading %s", hvacductvalsinfo->file); if(file_size > 1000000000){ - PRINTF(" - %.1f GB/%.1f s\n", ( float )file_size / 1000000000., total_time); + PRINTF(" - %.1f GB/%.1f s\n", (float)file_size / 1000000000., total_time); } else if(file_size > 1000000){ - PRINTF(" - %.1f MB/%.1f s\n", ( float )file_size / 1000000., total_time); + PRINTF(" - %.1f MB/%.1f s\n", (float)file_size / 1000000., total_time); } else{ - PRINTF(" - %.0f KB/%.1f s\n", ( float )file_size / 1000., total_time); + PRINTF(" - %.0f KB/%.1f s\n", (float)file_size / 1000., total_time); } hvacductvalsinfo->loaded = 1; } diff --git a/Source/smokeview/IOiso.c b/Source/smokeview/IOiso.c index 622e93d201..5b18e90ba6 100644 --- a/Source/smokeview/IOiso.c +++ b/Source/smokeview/IOiso.c @@ -1647,7 +1647,7 @@ void UpdateIsoType(void){ /* ------------------ IsoCompare ------------------------ */ -int IsoCompare( const void *arg1, const void *arg2 ){ +int IsoCompare(const void *arg1, const void *arg2){ isodata *isoi, *isoj; isoi = isoinfo + *(int *)arg1; @@ -1736,7 +1736,7 @@ void SetIsoLabels(float smin, float smax, /* ------------------ CompareIsoTriangles ------------------------ */ -int CompareIsoTriangles( const void *arg1, const void *arg2 ){ +int CompareIsoTriangles(const void *arg1, const void *arg2){ isotri *trii, *trij; float disti, distj; diff --git a/Source/smokeview/IOobjects.c b/Source/smokeview/IOobjects.c index 4c303152d0..71a723083f 100644 --- a/Source/smokeview/IOobjects.c +++ b/Source/smokeview/IOobjects.c @@ -191,7 +191,7 @@ float GetPoint2BoxDist(float boxmin[3], float boxmax[3], float p1[3], // if p1 is outside of box then return Dist(p1,p2) - for (i = 0; i < 3; i++){ + for(i = 0; i < 3; i++){ if(p1[i] < boxmin[i]) return Dist(p1, p2orig); if(p1[i] > boxmax[i]) return Dist(p1, p2orig); p2[i] = p2orig[i]; @@ -199,7 +199,7 @@ float GetPoint2BoxDist(float boxmin[3], float boxmax[3], float p1[3], // if p1 and p2 are both inside box then return Dist(p1,p2) - for (i = 0; i < 3; i++){ + for(i = 0; i < 3; i++){ if(p2[i] < boxmin[i]){ doit = 1; break; @@ -4717,7 +4717,7 @@ int CompareV2Devices(const void *arg1, const void *arg2){ /* ------------------ CompareV3Devices ------------------------ */ -int CompareV3Devices( const void *arg1, const void *arg2 ){ +int CompareV3Devices(const void *arg1, const void *arg2){ vdevicesortdata *vdevi, *vdevj; float *xyzi, *xyzj; int diri, dirj; @@ -5058,7 +5058,7 @@ int GetNDevices(char *file){ return 0; } - while (!feof(stream)){ + while(!feof(stream)){ fgets(buffer, buffer_len, stream); comma = strchr(buffer, ','); if(comma != NULL) *comma = 0; @@ -5087,7 +5087,7 @@ void RewindDeviceFile(FILE *stream){ rewind(stream); return; } - while (!feof(stream)){ + while(!feof(stream)){ fgets(buffer, buffer_len, stream); comma = strchr(buffer, ','); if(comma != NULL) *comma = 0; diff --git a/Source/smokeview/IOpart.c b/Source/smokeview/IOpart.c index 9d5e66c3ac..f53ca966cc 100644 --- a/Source/smokeview/IOpart.c +++ b/Source/smokeview/IOpart.c @@ -837,13 +837,13 @@ void CreatePartSizeFileFromPart(char *part5file_arg, char *part5sizefile_arg, LI FORTREAD_m(&nclasses_local, 4, 1, stream); NewMemory((void **)&numtypes_local, 2*nclasses_local* sizeof(int)); NewMemory((void **)&numpoints_local, nclasses_local* sizeof(int)); - for (i = 0; i < nclasses_local; i++){ + for(i = 0; i < nclasses_local; i++){ FORTREAD_m(numtypes_local+2*i, 4, 2, stream); numvals_local = numtypes_local[2 * i] + numtypes_local[2 * i + 1]; skip_local = 2*numvals_local*(4 + 30 + 4); fseek_m(stream, skip_local, SEEK_CUR); } - while (!feof_m(stream)){ + while(!feof_m(stream)){ float time_local; LINT frame_size_local; char format[128]; @@ -853,7 +853,7 @@ void CreatePartSizeFileFromPart(char *part5file_arg, char *part5sizefile_arg, LI FORTREAD_m(&time_local, 4, 1, stream); frame_size_local += 12; if(count_read != 1)break; - for (i = 0; i < nclasses_local; i++){ + for(i = 0; i < nclasses_local; i++){ FORTREAD_m(numpoints_local+ i, 4, 1, stream); frame_size_local += 12; skip_local = 4+4*NXYZ_COMP_PART*numpoints_local[i]+4; @@ -871,7 +871,7 @@ void CreatePartSizeFileFromPart(char *part5file_arg, char *part5sizefile_arg, LI fprintf(streamout_local, format, time_local, file_offset_arg); fprintf(streamout_local, "\n"); file_offset_arg += frame_size_local; - for (i = 0; i < nclasses_local; i++){ + for(i = 0; i < nclasses_local; i++){ fprintf(streamout_local, " %i\n", numpoints_local[i]); } } diff --git a/Source/smokeview/IOplot2d.c b/Source/smokeview/IOplot2d.c index ea86d39d0b..969d2f80fc 100644 --- a/Source/smokeview/IOplot2d.c +++ b/Source/smokeview/IOplot2d.c @@ -1059,7 +1059,7 @@ void DrawPlot2D(int option, float *x, float *z, float *z2, int n, char tvalmin[20], tvalmax[20]; int ndigits = 3; - float dfont = ( float )GetFontHeight(); + float dfont = (float)GetFontHeight(); xmin = x[0]; xmax = xmin; diff --git a/Source/smokeview/IOplot3d.c b/Source/smokeview/IOplot3d.c index da74bd5520..41f3bf5970 100644 --- a/Source/smokeview/IOplot3d.c +++ b/Source/smokeview/IOplot3d.c @@ -68,7 +68,7 @@ void MergePlot3DHistograms(void){ /* ------------------ Plot3dCompare ------------------------ */ -int Plot3dCompare( const void *arg1, const void *arg2 ){ +int Plot3dCompare(const void *arg1, const void *arg2){ plot3ddata *plot3di, *plot3dj; plot3di = plot3dinfo + *(int *)arg1; @@ -616,8 +616,7 @@ void DrawPlot3dTexture(meshdata *meshi){ /* +++++++++++++++++++++++++++ draw yz contours +++++++++++++++++++++++++++++++++++++ */ if(plotx>=0&&visx!=0){ - if(visVector==0 - ){ + if(visVector==0){ if(plotx<0){ plotx=ibar; UpdatePlotSlice(XDIR); @@ -733,8 +732,7 @@ void DrawPlot3dTexture(meshdata *meshi){ /* +++++++++++++++++++++++++++++++++ draw xz contours ++++++++++++++++++++++++++++++++++++++++ */ if(ploty>=0&&visy!=0){ - if(visVector==0 - ){ + if(visVector==0){ glBegin(GL_TRIANGLES); for(i=0; i=0&&visz!=0){ - if(visVector==0 - ){ + if(visVector==0){ if(plotz<0){ plotz=kbar; UpdatePlotSlice(ZDIR); @@ -950,8 +947,7 @@ void DrawPlot3dTexture(meshdata *meshi){ glEnd(); } } - if(visVector==0 - ){ + if(visVector==0){ glDisable(GL_TEXTURE_1D); } if(use_transparency_data==1){ @@ -1665,7 +1661,7 @@ void UpdatePlot3dMenuLabels(void){ /* ------------------ Plot3dListCompare ------------------------ */ -int Plot3dListCompare( const void *arg1, const void *arg2 ){ +int Plot3dListCompare(const void *arg1, const void *arg2){ float val1, val2; val1 = *(float *)arg1; diff --git a/Source/smokeview/IOscript.c b/Source/smokeview/IOscript.c index 29ab7e69e7..dfe4eb9768 100644 --- a/Source/smokeview/IOscript.c +++ b/Source/smokeview/IOscript.c @@ -1939,13 +1939,13 @@ void ScriptLoadIso(scriptdata *scripti, int meshnum){ update_readiso_geom_wrapup = UPDATE_ISO_START_ALL; CancelUpdateTriangles(); - for (i = nisoinfo - 1; i >= 0; i--){ + for(i = nisoinfo - 1; i >= 0; i--){ isodata* isoi; isoi = isoinfo + i; isoi->finalize = 0; } - for (i = nisoinfo-1; i >=0; i--){ + for(i = nisoinfo-1; i >=0; i--){ isodata* isoi; char label2[100]; int lencval, lenlabel; diff --git a/Source/smokeview/IOslice.c b/Source/smokeview/IOslice.c index 35eeae56e2..e00069b906 100644 --- a/Source/smokeview/IOslice.c +++ b/Source/smokeview/IOslice.c @@ -1510,7 +1510,7 @@ void UpdateAllSliceColors(int slicetype, int *errorcode){ /* ------------------ SliceCompare ------------------------ */ -int SliceCompare( const void *arg1, const void *arg2 ){ +int SliceCompare(const void *arg1, const void *arg2){ slicedata *slicei, *slicej; slicei = sliceinfo + *(int *)arg1; @@ -3070,7 +3070,7 @@ void GetSliceDataBounds(slicedata *sd, float *pmin, float *pmax){ } *pmin = pdata[0]; *pmax = pdata[0]; - for (i = 0; i < ndata; i++){ + for(i = 0; i < ndata; i++){ *pmin = MIN(*pmin, pdata[i]); *pmax = MAX(*pmax, pdata[i]); } @@ -4181,7 +4181,7 @@ FILE_SIZE ReadSlice(const char *file, int ifile, int time_frame, float *time_val show_slice_average = 1; #ifdef pp_SLICEFRAME - qvalptrs = ( float **)sd->frameinfo->frameptrs; + qvalptrs = (float **)sd->frameinfo->frameptrs; #else int i; NewMemory((void **)&qvalptrs, sd->ntimes*sizeof(float *)); @@ -6801,7 +6801,7 @@ void ComputeOpacityCorrections(meshdata *meshi, float *xyz0, float *normal){ /* ------------------ CompareLoadedSliceList ------------------------ */ -int CompareLoadedSliceList( const void *arg1, const void *arg2 ){ +int CompareLoadedSliceList(const void *arg1, const void *arg2){ slicedata *slicei, *slicej; float position_i, position_j; int dir; @@ -7598,7 +7598,7 @@ void DrawSliceFrame(){ glBlendEquation(GL_FUNC_ADD); } } - for (ii = 0; ii < npatchinfo; ii++){ + for(ii = 0; ii < npatchinfo; ii++){ patchdata *patchi; patchi = patchinfo + ii; @@ -9556,7 +9556,7 @@ void SortSlices(void){ splitsliceinfoptr[i] = splitsliceinfo + i; } if(nsplitsliceinfo > 1){ - qsort(( splitslicedata ** )splitsliceinfoptr, ( size_t )nsplitsliceinfo, sizeof(splitslicedata *), CompareSortSlices); + qsort((splitslicedata **)splitsliceinfoptr, ( size_t )nsplitsliceinfo, sizeof(splitslicedata *), CompareSortSlices); } } diff --git a/Source/smokeview/IOsmoke.c b/Source/smokeview/IOsmoke.c index b11db31c48..e19a05fccf 100644 --- a/Source/smokeview/IOsmoke.c +++ b/Source/smokeview/IOsmoke.c @@ -4302,7 +4302,7 @@ FILE_SIZE ReadSmoke3D(int time_frame,int ifile_arg,int load_flag, int first_time int *nxyzptr; int offset; - nxyzptr = ( int * )smoke3di->frameinfo->header; + nxyzptr = (int *)smoke3di->frameinfo->header; if(smoke3di->compression_type == COMPRESSED_ZLIB){ offset = 12; smoke3di->is1 = nxyzptr[2]; @@ -4948,7 +4948,7 @@ void *MtMergeSmoke3D(void *arg){ int i; smokethreaddata *smokei; - smokei = ( smokethreaddata * )arg; + smokei = (smokethreaddata *)arg; nthreads = smokei->nthreads; ithread = smokei->ithread; diff --git a/Source/smokeview/IOvolsmoke.c b/Source/smokeview/IOvolsmoke.c index 7d33938b97..86778bcf49 100644 --- a/Source/smokeview/IOvolsmoke.c +++ b/Source/smokeview/IOvolsmoke.c @@ -536,13 +536,13 @@ void MakeFireColors(float temp_min, float temp_max, int nfire_colors_arg){ FILE *stream; stream = fopen("testfire.csv", "w"); #endif - dtemp = (temp_max - temp_min) / ( float )(nfire_colors_arg - 1); + dtemp = (temp_max - temp_min) / (float)(nfire_colors_arg - 1); FREEMEMORY(fire_rgbs); NewMemory((void **)&fire_rgbs, 3*nfire_colors_arg*sizeof(float)); for(i = 0; i < nfire_colors_arg; i++){ float temp, fire_emission[3]; - temp = temp_min + ( float )i*dtemp; + temp = temp_min + (float)i*dtemp; //float xyz[3]; GetRGBFireVal(temp, fire_emission); //Xyz2Rgb(&HDTVsystem, xyz, fire_rgb); diff --git a/Source/smokeview/colortimebar.c b/Source/smokeview/colortimebar.c index f65802f343..d0c3e60daa 100644 --- a/Source/smokeview/colortimebar.c +++ b/Source/smokeview/colortimebar.c @@ -884,9 +884,9 @@ void CheckLab(void){ unsigned char rgbval[3]; float lab[3]; - rgbval[0] = MIN(( unsigned char )k,255); - rgbval[1] = MIN(( unsigned char )j,255); - rgbval[2] = MIN(( unsigned char )i,255); + rgbval[0] = MIN((unsigned char)k,255); + rgbval[1] = MIN((unsigned char)j,255); + rgbval[2] = MIN((unsigned char)i,255); Rgb2Lab(rgbval, lab); memcpy(labxyz, lab, 3 * sizeof(float)); memcpy(labrgb, rgbval, 3); diff --git a/Source/smokeview/drawGeometry.c b/Source/smokeview/drawGeometry.c index ca7dd848a7..ae1474ffa6 100644 --- a/Source/smokeview/drawGeometry.c +++ b/Source/smokeview/drawGeometry.c @@ -844,7 +844,7 @@ void GetBlockVals( float *xmin, float *xmax, int HaveCircularVents(void){ int i; - for (i = 0; i < nmeshes; i++){ + for(i = 0; i < nmeshes; i++){ meshdata* meshi; meshi = meshinfo + i; @@ -1698,7 +1698,7 @@ void ReadCADGeom(cadgeomdata *cd){ /* ------------------ CompareQuad ------------------------ */ -int CompareQuad( const void *arg1, const void *arg2 ){ +int CompareQuad(const void *arg1, const void *arg2){ int i1, i2; cadgeomdata *cd; cadquad *quadi, *quadj; @@ -2772,7 +2772,7 @@ void SetCullVis(void){ /* ------------------ CompareSingleFaces0 ------------------------ */ -int CompareSingleFaces0( const void *arg1, const void *arg2 ){ +int CompareSingleFaces0(const void *arg1, const void *arg2){ facedata *facei, *facej; int dirs[6]; @@ -2844,7 +2844,7 @@ int CompareSingleFaces0( const void *arg1, const void *arg2 ){ /* ------------------ CompareSingleFaces ------------------------ */ -int CompareSingleFaces( const void *arg1, const void *arg2 ){ +int CompareSingleFaces(const void *arg1, const void *arg2){ facedata *facei, *facej; facei = *(facedata **)arg1; @@ -2888,7 +2888,7 @@ int CompareSingleFaces( const void *arg1, const void *arg2 ){ /* ------------------ CompareColorFaces ------------------------ */ -int CompareColorFaces( const void *arg1, const void *arg2 ){ +int CompareColorFaces(const void *arg1, const void *arg2){ facedata *facei, *facej; facei = *(facedata **)arg1; @@ -3610,7 +3610,7 @@ void DrawFaces(){ /* ------------------ CompareTransparentFaces ------------------------ */ -int CompareTransparentFaces( const void *arg1, const void *arg2 ){ +int CompareTransparentFaces(const void *arg1, const void *arg2){ facedata *facei, *facej; facei = *(facedata **)arg1; @@ -4099,7 +4099,7 @@ void AllocateFaces(){ /* ------------------ CompareBlock ------------------------ */ -int CompareBlock( const void *arg1, const void *arg2 ){ +int CompareBlock(const void *arg1, const void *arg2){ blockagedata *bc1,*bc2; int i1, i2; @@ -5679,7 +5679,7 @@ culldata *GetFacePort(meshdata *meshi, facedata *facei){ /* ------------------ CompareBlockage ------------------------ */ -int CompareBlockage( const void *arg1, const void *arg2 ){ +int CompareBlockage(const void *arg1, const void *arg2){ blockagedata *bc1, *bc2; int *ijk1, *ijk2; diff --git a/Source/smokeview/glui_colorbar.cpp b/Source/smokeview/glui_colorbar.cpp index 77e63a3f3c..a68d180541 100644 --- a/Source/smokeview/glui_colorbar.cpp +++ b/Source/smokeview/glui_colorbar.cpp @@ -735,9 +735,9 @@ extern "C" void GLUIColorbarCB(int var){ FilterCSVFilename(colorbar_filename); break; case COLORBAR_LAB2GEN: - cb_rgb[0] = CLAMP(( int )(cb_frgb2[0] + 0.5), 0, 255); - cb_rgb[1] = CLAMP(( int )(cb_frgb2[1] + 0.5), 0, 255); - cb_rgb[2] = CLAMP(( int )(cb_frgb2[2] + 0.5), 0, 255); + cb_rgb[0] = CLAMP((int)(cb_frgb2[0] + 0.5), 0, 255); + cb_rgb[1] = CLAMP((int)(cb_frgb2[1] + 0.5), 0, 255); + cb_rgb[2] = CLAMP((int)(cb_frgb2[2] + 0.5), 0, 255); SPINNER_cb_rgb[0]->set_int_val(cb_rgb[0]); SPINNER_cb_rgb[1]->set_int_val(cb_rgb[1]); SPINNER_cb_rgb[2]->set_int_val(cb_rgb[2]); diff --git a/Source/smokeview/glui_geometry.cpp b/Source/smokeview/glui_geometry.cpp index fc686bdd03..0090518fad 100644 --- a/Source/smokeview/glui_geometry.cpp +++ b/Source/smokeview/glui_geometry.cpp @@ -569,7 +569,7 @@ void HvacCB(int var){ break; case HVAC_SHOWALL_CONNECTIONS: case HVAC_HIDEALL_CONNECTIONS: - for (i = 0; i < nhvacconnectinfo; i++){ + for(i = 0; i < nhvacconnectinfo; i++){ hvacconnectdata *hi; hi = hvacconnectinfo + i; @@ -631,7 +631,7 @@ extern "C" void GLUIGeometrySetup(int main_window){ hvac_show_networks = 1; PANEL_hvac_network = glui_geometry->add_panel_to_panel(ROLLOUT_hvac, "networks"); } - for (i = 0; i < nhvacinfo; i++){ + for(i = 0; i < nhvacinfo; i++){ hvacdata* hvaci; hvaci = hvacinfo + i; @@ -647,7 +647,7 @@ extern "C" void GLUIGeometrySetup(int main_window){ NewMemory((void **)&CHECKBOX_hvac_show_connections, nhvacconnectinfo*sizeof(GLUI_Checkbox *)); glui_geometry->add_column_to_panel(PANEL_hvac_group1, false); PANEL_hvac_connections = glui_geometry->add_panel_to_panel(PANEL_hvac_group1, "connections"); - for (i = 0; i < nhvacconnectinfo; i++){ + for(i = 0; i < nhvacconnectinfo; i++){ hvacconnectdata *hi; char label[100]; diff --git a/Source/smokeview/glui_objects.cpp b/Source/smokeview/glui_objects.cpp index fc272cc86c..e69f72cb35 100644 --- a/Source/smokeview/glui_objects.cpp +++ b/Source/smokeview/glui_objects.cpp @@ -348,7 +348,7 @@ void UpdateShowWindRoses(void){ int icheckbox; icheckbox=0; - for (i = 0; i < nzwindtreeinfo; i++){ + for(i = 0; i < nzwindtreeinfo; i++){ treedevicedata *treei; int j; int idev; @@ -356,7 +356,7 @@ void UpdateShowWindRoses(void){ treei = zwindtreeinfo[i]; idev = 0; - for (j = treei->first; j <= treei->last; j++){ + for(j = treei->first; j <= treei->last; j++){ vdevicesortdata *vdevsorti; vdevicedata *vd; diff --git a/Source/smokeview/infoheader.c b/Source/smokeview/infoheader.c index 1ff46dfa2a..1131f8dc70 100644 --- a/Source/smokeview/infoheader.c +++ b/Source/smokeview/infoheader.c @@ -39,7 +39,7 @@ int addTitleLine(titledata *titleinfo_ptr, const char *string){ // walk through all the title lines and clear them int clearTitleLines(titledata *titleinfo_ptr){ int i; - for (i = 0; i < titleinfo_ptr->nlines; i++){ + for(i = 0; i < titleinfo_ptr->nlines; i++){ FREEMEMORY(titleinfo_ptr->lines[i]); titleinfo_ptr->lines[i]=NULL; } @@ -116,7 +116,7 @@ int renderInfoHeader(titledata *titleinfo_ptr){ } int i; - for (i = 0; i < titleinfo_ptr->nlines; i++){ + for(i = 0; i < titleinfo_ptr->nlines; i++){ OutputText(left, pen_pos, titleinfo_ptr->lines[i]); pen_pos -= titleinfo_ptr->text_height; pen_pos -= titleinfo_ptr->line_space; diff --git a/Source/smokeview/menus.c b/Source/smokeview/menus.c index 49d8f3276a..f95fced3a1 100644 --- a/Source/smokeview/menus.c +++ b/Source/smokeview/menus.c @@ -310,13 +310,13 @@ void PrintFileLoadTimes(int file_count, FILE_SIZE load_size, float load_time){ } } if(load_size > 1000000000){ - PRINTF("Loaded %.2f GB in %.2f s (%s)\n", ( float )load_size / 1000000000., load_time, crate); + PRINTF("Loaded %.2f GB in %.2f s (%s)\n", (float)load_size / 1000000000., load_time, crate); } else if(load_size > 1000000){ - PRINTF("Loaded %.2f MB in %.2f s (%s)\n", ( float )load_size / 1000000., load_time, crate); + PRINTF("Loaded %.2f MB in %.2f s (%s)\n", (float)load_size / 1000000., load_time, crate); } else{ - PRINTF("Loaded %.2f kB in %.2f s (%s)\n", ( float )load_size / 1000., load_time, crate); + PRINTF("Loaded %.2f kB in %.2f s (%s)\n", (float)load_size / 1000., load_time, crate); } printf("\n"); } @@ -353,7 +353,7 @@ void OpenSMVFile(char *filebuffer,int filebufferlength,int *openfile){ if(GetOpenFileName(&openfinfo)){ STRCPY(smv_directory,""); strncat(smv_directory,filebuffer,openfinfo.nFileOffset); - if( _chdir( smv_directory ) ){ + if( _chdir( smv_directory ) ){ PRINTF( "Unable to locate the directory: %s\n", smv_directory ); } else{ @@ -635,7 +635,7 @@ void ShowAllSlices(char *type1, char *type2){ if( (type1 != NULL&&STRCMP(slicei->label.longlabel, type1) == 0) || (type2 != NULL&&STRCMP(slicei->label.longlabel, type2) == 0) - ){ + ){ sliceinfo[i].display = 1; slicefile_labelindex = slicei->slicefile_labelindex; } @@ -4123,7 +4123,7 @@ void LoadAllPartFiles(int partnum){ #ifdef pp_PARTFRAME || partnum==RELOAD_LOADED_PART_FILES || partnum == LOAD_ALL_PART_FILES #endif - ){ + ){ if(partnum==LOAD_ALL_PART_FILES||(partnum==RELOAD_LOADED_PART_FILES&&parti->loaded==1)||partnum==i){ parti->loadstatus = FILE_LOADING; THREADcontrol(partload_threads, THREAD_UNLOCK); @@ -4215,7 +4215,7 @@ void SetupPart(int value){ void *MtLoadAllPartFiles(void *arg){ int *valptr; - valptr = ( int * )(arg); + valptr = (int *)(arg); LoadAllPartFiles(*valptr); #ifdef pp_PARTFRAME return NULL; @@ -6146,7 +6146,7 @@ void LoadBoundaryMenu(int value){ patchi->finalize = 0; if(patchi->loaded == 1 && load_only_when_unloaded == 0 - ){ + ){ ReadBoundary(i, UNLOAD, &errorcode); } } @@ -8368,7 +8368,7 @@ void InitLoadMultiSliceMenu(int *loadmultislicemenuptr, int *loadsubmslicemenu, int *nsubpatchmenus_s, int sliceskipmenu, int sliceloadoptionmenu, int duplicateslicemenu, int loadslicemenu, int nmultisliceloaded, int unloadmultislicemenu , int *loadsubslicexmenuptr, int *loadsubsliceymenuptr, int *loadsubslicezmenuptr, int *loadsubslicexyzmenuptr - ){ + ){ int i, loadmultislicemenu; int nloadsubmslicemenu; int iloadsubpatchmenu_s; @@ -8661,7 +8661,7 @@ void InitMultiVectorSubMenu(int **loadsubmvslicemenuptr){ void InitMultiVectorLoadMenu(int *loadmultivslicemenuptr, int *loadsubmvslicemenu, int duplicatevectorslicemenu, int vsliceloadmenu, int sliceloadoptionmenu, int unloadmultivslicemenu , int *loadsubvectorslicexmenuptr, int *loadsubvectorsliceymenuptr, int *loadsubvectorslicezmenuptr, int *loadsubvectorslicexyzmenuptr - ){ + ){ int loadmultivslicemenu; int nloadsubmvslicemenu; int i; @@ -9183,7 +9183,7 @@ static int menu_count=0; if( strncmp(patchi->label.shortlabel,"TEMP",4) == 0|| strncmp(patchi->label.shortlabel,"temp",4) == 0 - ){ + ){ local_do_threshold=1; } } @@ -10567,7 +10567,7 @@ static int menu_count=0; if(partclassj->col_diameter>=0||partclassj->col_length>=0||partclassj->device_name!=NULL|| (partclassj->prop!=NULL&&partclassj->prop->smokeview_id!=NULL)|| (partclassj->col_u_vel>=0&&partclassj->col_v_vel>=0&&partclassj->col_w_vel>=0) - ){ + ){ if(propi->class_vis[j]==1){ strcpy(menulabel,_("using:")); } @@ -10601,7 +10601,7 @@ static int menu_count=0; if( (partclassj->smv_device!=NULL&&partclassj->device_name!=NULL)|| (partclassj->prop!=NULL&&partclassj->prop->smokeview_id!=NULL) - ){ + ){ if(partclassj->device_name!=NULL){ strcpy(menulabel," "); if(partclassj->vis_type==PART_SMV_DEVICE){ diff --git a/Source/smokeview/readsmv.c b/Source/smokeview/readsmv.c index aa25965a2f..620688a1ef 100644 --- a/Source/smokeview/readsmv.c +++ b/Source/smokeview/readsmv.c @@ -442,7 +442,7 @@ FILE_SIZE ReadCSVFile(csvfiledata *csvfi, int flag){ /* ------------------ CompareCSV ------------------------ */ -int CompareCSV( const void *arg1, const void *arg2 ){ +int CompareCSV(const void *arg1, const void *arg2){ csvfiledata *csvi, *csvj; csvi = (csvfiledata *)arg1; @@ -3305,15 +3305,15 @@ int GetSmoke3DType(char *label){ int CompareLabel(const void *arg1, const void *arg2){ char *x, *y; - x = *( char ** )arg1; - y = *( char ** )arg2; + x = *(char **)arg1; + y = *(char **)arg2; return strcmp(x, y); } /* ------------------ CompareSmoketypes ------------------------ */ -int CompareSmoketypes( const void *arg1, const void *arg2 ){ +int CompareSmoketypes(const void *arg1, const void *arg2){ smoke3dtypedata *smoketypei, *smoketypej; smoke3ddata *smoke3di, *smoke3dj; char *labeli, *labelj; @@ -5608,7 +5608,7 @@ int ParseSMOKE3DProcess(bufferstreamdata *stream, char *buffer, int *nn_smoke3d_ smoke3di->reg_file = SMOKE3DBUFFER(len + 1); STRCPY(smoke3di->reg_file, bufferptr); for(i=0; i<6; i++){ - smoke3di->alphas_dir[i] = ( unsigned char * )smoke3d_buffer; + smoke3di->alphas_dir[i] = (unsigned char *)smoke3d_buffer; smoke3d_buffer += 256; } smoke3di->ntimes = 0; @@ -8429,7 +8429,7 @@ int ReadSMV_Parse(bufferstreamdata *stream){ for(i = 0; i < nhvacductinfo; i++){ hvac_network_labels[i+nhvacnodeinfo] = hvacductinfo[i].network_name; } - qsort(( char * )hvac_network_labels, ( size_t )(nhvacnodeinfo + nhvacductinfo), sizeof(char *), CompareLabel); + qsort((char *)hvac_network_labels, ( size_t )(nhvacnodeinfo + nhvacductinfo), sizeof(char *), CompareLabel); nhvacinfo = 1; for(i = 1; i < nhvacnodeinfo + nhvacductinfo; i++){ if(strcmp(hvac_network_labels[nhvacinfo-1], hvac_network_labels[i]) == 0)continue; @@ -11590,8 +11590,7 @@ typedef struct { ++++++++++++++++++++++ PART ++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ - if(MatchSMV(buffer,"PRT5")==1||MatchSMV(buffer,"EVA5")==1 - ){ + if(MatchSMV(buffer,"PRT5")==1||MatchSMV(buffer,"EVA5")==1){ int return_val; START_TIMER(PRT5_timer); diff --git a/Source/smokeview/smokeheaders.h b/Source/smokeview/smokeheaders.h index 6e7e62d95c..dd569ae172 100644 --- a/Source/smokeview/smokeheaders.h +++ b/Source/smokeview/smokeheaders.h @@ -877,7 +877,7 @@ EXTERNCPP void SetCullVis(void); EXTERNCPP void ExtractFrustum(void); EXTERNCPP int BoxInFrustum(float *xx, float *yy, float *zz, int n); EXTERNCPP int MeshInFrustum(meshdata *meshi); -EXTERNCPP int RectangleInFrustum( float *x11, float *x12, float *x22, float *x21); +EXTERNCPP int RectangleInFrustum(float *x11, float *x12, float *x22, float *x21); EXTERNCPP int UpdateSmoke3D(smoke3ddata *smoke3di); EXTERNCPP void DrawSmokeFrame(void); EXTERNCPP void DrawVolSmokeFrame(void); diff --git a/Source/smokeview/smv_geometry.c b/Source/smokeview/smv_geometry.c index f7c21308c4..841fc02486 100644 --- a/Source/smokeview/smv_geometry.c +++ b/Source/smokeview/smv_geometry.c @@ -226,7 +226,7 @@ void DrawFilled2Tetra(float *v1, float *v2, float *v3, float *v4, /* ------------------ CompareFloats ------------------------ */ -int CompareFloats( const void *arg1, const void *arg2 ){ +int CompareFloats(const void *arg1, const void *arg2){ float x, y; x=*(float *)arg1; y=*(float *)arg2; @@ -246,7 +246,7 @@ void RemoveDupFloats(float **valsptr, int *nvals,int *ivals, float dval_min){ if(*nvals==0)return; nv = *nvals; vals = *valsptr; - qsort( (float *)vals, (size_t)nv, sizeof( float ), CompareFloats ); + qsort( (float *)vals, (size_t)nv, sizeof(float), CompareFloats ); ii=1; for(i=1;i 0 )continue; if( frustum[p][0]*x12[0] + frustum[p][1]*x12[1] + frustum[p][2]*x12[2] + frustum[p][3] > 0 )continue; if( frustum[p][0]*x22[0] + frustum[p][1]*x22[1] + frustum[p][2]*x22[2] + frustum[p][3] > 0 )continue; @@ -914,7 +914,7 @@ void GetScreenMapping(float *xyz0, float *screen_perm){ #define SETSCREEN(i1,i2,i3,dscreen)\ if(i1==0)set=0;\ - if(set==0&&ABS((dscreen)[i1])>MAX( ABS((dscreen)[i2]) , ABS((dscreen)[i3]) ) ){\ + if(set==0&&ABS((dscreen)[i1])>MAX( ABS((dscreen)[i2]) , ABS((dscreen)[i3]) )){\ (dscreen)[i1]=SIGN((dscreen)[i1]);\ (dscreen)[i2]=0.0;\ (dscreen)[i3]=0.0;\ diff --git a/Source/smokeview/update.c b/Source/smokeview/update.c index 10cfa975ab..bd22f3a3bf 100644 --- a/Source/smokeview/update.c +++ b/Source/smokeview/update.c @@ -17,7 +17,7 @@ /* ------------------ CompareFloat ------------------------ */ -int CompareFloat( const void *arg1, const void *arg2 ){ +int CompareFloat(const void *arg1, const void *arg2){ float x, y; x=*(float *)arg1; @@ -152,7 +152,7 @@ void UpdateFrameNumber(int changetime){ slice_time = sd->itime; } } - for (i = 0; i < npatchinfo; i++){ + for(i = 0; i < npatchinfo; i++){ patchdata *patchi; patchi = patchinfo + i; @@ -548,7 +548,7 @@ void UpdateShow(void){ patchflag=0; if(visTimeBoundary==1){ - for (i = 0; i < ngeominfo; i++){ + for(i = 0; i < ngeominfo; i++){ geomdata *geomi; geomi = geominfo + i;