Skip to content

Commit

Permalink
Merge pull request #1984 from gforney/master
Browse files Browse the repository at this point in the history
formatting edits - ( void ** ) -> (void **) , switch (var) -> switch(var) , ' ;' -> ';'
  • Loading branch information
gforney authored Aug 13, 2024
2 parents c681ce0 + 973dc8f commit 31b0de1
Show file tree
Hide file tree
Showing 30 changed files with 97 additions and 97 deletions.
12 changes: 6 additions & 6 deletions Source/fds2fed/fds2fed.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int ReadSMV(char *smvfile){
if(nmeshinfo > 0){
int i;

NewMemory(( void ** )&meshinfo, nmeshinfo * sizeof(meshdata));
NewMemory((void **)&meshinfo, nmeshinfo * sizeof(meshdata));
for(i = 0; i < nmeshinfo; i++){
meshdata *meshi;

Expand Down Expand Up @@ -107,9 +107,9 @@ int ReadSMV(char *smvfile){
meshi->ibar = ibar;
meshi->jbar = jbar;
meshi->kbar = kbar;
if(meshi->ibar>0)NewMemory(( void ** )&meshi->xplt, (ibar+1)*sizeof(float));
if(meshi->jbar > 0)NewMemory(( void ** )&meshi->yplt, (jbar + 1) * sizeof(float));
if(meshi->kbar > 0)NewMemory(( void ** )&meshi->zplt, (kbar + 1) * sizeof(float));
if(meshi->ibar>0)NewMemory((void **)&meshi->xplt, (ibar+1)*sizeof(float));
if(meshi->jbar > 0)NewMemory((void **)&meshi->yplt, (jbar + 1) * sizeof(float));
if(meshi->kbar > 0)NewMemory((void **)&meshi->zplt, (kbar + 1) * sizeof(float));
continue;
}
if(Match(buffer, "TRNX") == 1|| Match(buffer, "TRNY") == 1|| Match(buffer, "TRNZ") == 1){
Expand Down Expand Up @@ -531,8 +531,8 @@ void MakeFEDSlice(feddata *fedi){
int i;
float fedo20, hvco20, fedco0;

NewMemory(( void ** )&times, fedi->nframes * sizeof(float));
NewMemory(( void ** )&vals, fedi->nframes * fedi->memframesize * sizeof(float));
NewMemory((void **)&times, fedi->nframes * sizeof(float));
NewMemory((void **)&vals, fedi->nframes * fedi->memframesize * sizeof(float));
fedi->times = times;
fedi->vals = vals;
for(i = 0; i < fedi->memframesize; i++){
Expand Down
4 changes: 2 additions & 2 deletions Source/shared/IOframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ int FRAMEGetNFrames(char *file, int type){
return 0;
}
if(frameinfo != NULL){
NewMemory(( void ** )&frameinfo->bufferinfo, sizeof(bufferdata));
NewMemory((void **)&frameinfo->bufferinfo, sizeof(bufferdata));
frameinfo->bufferinfo->file = file;
frameinfo->bufferinfo->buffer = NULL;
frameinfo->bufferinfo->nbuffer = 0;
Expand Down Expand Up @@ -489,7 +489,7 @@ void GetBoundaryFrameInfo(bufferdata *bufferinfo, int *headersizeptr, int **fram


nsubframes = npatch;
NewMemory(( void ** )&subframeoffsets, nsubframes*sizeof(int));
NewMemory((void **)&subframeoffsets, nsubframes*sizeof(int));
NewMemory((void **)&subframesizes, nsubframes*sizeof(int));
subframeoffsets[0] = 0;
datasize = 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/shared/file_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ int MakeFile(char *file, int size){
stream = fopen(file, "w");
if(stream == NULL)return 0;

NewMemory(( void ** )&buffer, BUFFERSIZE);
NewMemory((void **)&buffer, BUFFERSIZE);
for(i = 0; i < BUFFERSIZE; i++){
buffer[i] = i % 255;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/shared/fopen.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void RemoveOpenFile(FILE *stream){
}
nopeninfo--;
if(nopeninfo > 0){
ResizeMemory(( void ** )&openinfo, nopeninfo * sizeof(opendata));
ResizeMemory((void **)&openinfo, nopeninfo * sizeof(opendata));
}
else{
nopeninfo=0;
Expand Down
2 changes: 1 addition & 1 deletion Source/shared/getdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ void getpartdataframe(FILE *file, int nclasses, int *nquantities, int *npoints,
pstart += nvalues;

// get tag data
int ntagvalues = tagstart + nparticles ;
int ntagvalues = tagstart + nparticles;
*error = fortread(&tagdata[tagstart], sizeof(*tagdata), ntagvalues, file);
if(*error != 0) return;
tagstart += ntagvalues;
Expand Down
2 changes: 1 addition & 1 deletion Source/shared/getdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void getzonedata(const char *zonefilename, int *nzonet, int *nrooms,
void getpatchdata(FILE *file, int npatch, int *pi1, int *pi2, int *pj1,
int *pj2, int *pk1, int *pk2, float *patchtime, float *pqq,
int *npqq, int *file_size, int *error);
void getdata1(FILE *file, int *ipart, int *error) ;
void getdata1(FILE *file, int *ipart, int *error);
void GetSliceFileDirection(int is1, int *is2ptr, int *iis1ptr, int *iis2ptr, int js1,
int *js2ptr, int ks1, int *ks2ptr, int *idirptr, int *joffptr,
int *koffptr, int *volsliceptr);
Expand Down
4 changes: 2 additions & 2 deletions Source/shared/readobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void ParseSmvObjectString(object_collection *objectscoll, char *string,
last_in_token = 0;
len = strlen(string);
for (i = 0; i <= len; i++){
switch (*c){
switch(*c){
case '"':
in_quote = 1 - in_quote;
in_token = 1;
Expand Down Expand Up @@ -559,7 +559,7 @@ char *ParseObjectFrame(object_collection *objectscoll, const char *buffer_in,
tokendata *toki;

toki = frame->command_list[i];
switch (toki->command){
switch(toki->command){
int j, if_level;

case SV_IF:
Expand Down
4 changes: 2 additions & 2 deletions Source/shared/stdio_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ FILE_m *fopen_b(char *file, unsigned char *buffer, size_t nbuffer, char *mode){
if(file == NULL || strlen(file) == 0 || mode == NULL || strlen(mode) < 2)return NULL;
if(strcmp(mode, "rb") !=0)return NULL;

if(NewMemory(( void ** )&m_file, strlen(file) + 1) == 0){ // memory allocation failed so abort
if(NewMemory((void **)&m_file, strlen(file) + 1) == 0){ // memory allocation failed so abort
return NULL;
}
strcpy(m_file, file);

if(NewMemory(( void ** )&stream_m, sizeof(FILE_m)) == 0){
if(NewMemory((void **)&stream_m, sizeof(FILE_m)) == 0){
FREEMEMORY(m_file);
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/shared/threader.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ threaderdata *THREADinit(int *nthreads_ptr, int *use_threads_ptr, void *(*run_ar
// return NULL;
// }

NewMemory(( void ** )&thi, sizeof(threaderdata));
NewMemory((void **)&thi, sizeof(threaderdata));

if(nthreads_ptr != NULL && *nthreads_ptr > 1)nthreads_local = *nthreads_ptr;
if(nthreads_local > MAX_THREADS)nthreads_local = MAX_THREADS;
Expand All @@ -55,7 +55,7 @@ threaderdata *THREADinit(int *nthreads_ptr, int *use_threads_ptr, void *(*run_ar
thi->use_threads = use_threads_local;
thi->run = run_arg;
#ifdef pp_THREAD
NewMemory(( void ** )&thi->thread_ids, MAX_THREADS * sizeof(pthread_t));
NewMemory((void **)&thi->thread_ids, MAX_THREADS * sizeof(pthread_t));
pthread_mutex_init(&thi->mutex, NULL);
#endif
return thi;
Expand Down
4 changes: 2 additions & 2 deletions Source/smokeview/IOgeometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ FILE_SIZE ReadGeomData(patchdata *patchi, slicedata *slicei, int load_flag, int
ntimes_local = GetGeomDataSize(patchi->file, &nvals, time_frame, cvals_offsets, cvals_sizes, geom_offsets, &geom_offset_flag, &max_buffer_size, &error);
}
if(max_buffer_size > 0){
NewMemory(( void ** )&cbuffer, max_buffer_size);
NewMemory((void **)&cbuffer, max_buffer_size);
patchi->cbuffer = cbuffer;
}
else{
Expand Down Expand Up @@ -2269,7 +2269,7 @@ FILE_SIZE ReadGeomData(patchdata *patchi, slicedata *slicei, int load_flag, int
#ifdef pp_SLICEFRAME
qvalptrs = ( float ** )slicei->frameinfo->frameptrs;
#else
NewMemory(( void ** )&qvalptrs, ntimes*sizeof(float *));
NewMemory((void **)&qvalptrs, ntimes*sizeof(float *));
for(i = 0; i < ntimes; i++){
qvalptrs[i] = slicei->patchgeom->geom_vals + i*data_per_timestep;
}
Expand Down
20 changes: 10 additions & 10 deletions Source/smokeview/IOpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ int GetPartHeader(partdata *parti, int *nf_all, int option_arg, int print_option

fseek_m(stream, 2 * (4 + 4 + 4), SEEK_SET);
fseek_m(stream, 4, SEEK_CUR); fread_m(&n_part, sizeof(int), 1, stream); fseek_m(stream, 4, SEEK_CUR);
NewMemory(( void ** )&n_quants, n_part*sizeof(int));
NewMemory((void **)&n_quants, n_part*sizeof(int));
for(i = 0; i < n_part; i++){
int vals[2];

Expand Down Expand Up @@ -1731,9 +1731,9 @@ int GetPartHeader(partdata *parti, int *nf_all, int option_arg, int print_option
// allocate memory for number of time steps * number of classes

CheckMemory;
NewMemory(( void ** )&parti->data5, parti->nclasses * parti->ntimes * sizeof(part5data));
NewMemory(( void ** )&parti->times, parti->ntimes * sizeof(float));
NewMemory(( void ** )&parti->times_map, parti->ntimes);
NewMemory((void **)&parti->data5, parti->nclasses * parti->ntimes * sizeof(part5data));
NewMemory((void **)&parti->times, parti->ntimes * sizeof(float));
NewMemory((void **)&parti->times_map, parti->ntimes);

// free memory for x, y, z frame data

Expand Down Expand Up @@ -1784,9 +1784,9 @@ int GetPartHeader(partdata *parti, int *nf_all, int option_arg, int print_option
if(npoints_local > partclassj->maxpoints)partclassj->maxpoints = npoints_local;
if(npoints_local > 0){
if(partfast == NO){
NewMemory(( void ** )&datacopy_local->dsx, npoints_local * sizeof(float));
NewMemory(( void ** )&datacopy_local->dsy, npoints_local * sizeof(float));
NewMemory(( void ** )&datacopy_local->dsz, npoints_local * sizeof(float));
NewMemory((void **)&datacopy_local->dsx, npoints_local * sizeof(float));
NewMemory((void **)&datacopy_local->dsy, npoints_local * sizeof(float));
NewMemory((void **)&datacopy_local->dsz, npoints_local * sizeof(float));
}
}
datacopy_local++;
Expand Down Expand Up @@ -1817,9 +1817,9 @@ int GetPartHeader(partdata *parti, int *nf_all, int option_arg, int print_option
FREEMEMORY(parti->irvals);
FREEMEMORY(n_quants);

NewMemory(( void ** )&parti->vis_part, MAX(nall_points_local, 1));
NewMemory(( void ** )&parti->sort_tags, 2*MAX(nall_points_local, 1)*sizeof(int));
NewMemory(( void ** )&parti->irvals, MAX(nall_points_types_local, 1));
NewMemory((void **)&parti->vis_part, MAX(nall_points_local, 1));
NewMemory((void **)&parti->sort_tags, 2*MAX(nall_points_local, 1)*sizeof(int));
NewMemory((void **)&parti->irvals, MAX(nall_points_types_local, 1));

datacopy_local = parti->data5;
nall_points_types_local = 0;
Expand Down
6 changes: 3 additions & 3 deletions Source/smokeview/IOscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ int ParseSLCFTokens(char *buffer, char **keywords, int *type, int nkeywords, int
}
if(val==NULL)return i;
val = TrimFrontBack(val);
switch (type[keyword_index]){
switch(type[keyword_index]){
case TOKEN_INT:
sscanf(val, "%i", itokens+i);
break;
Expand Down Expand Up @@ -1308,7 +1308,7 @@ int CompileScript(char *scriptfile){
}

for(i=0;i<ntokens;i++){
switch (tokens[i]){
switch(tokens[i]){
char label[100];

case KW_QUANTITY:
Expand Down Expand Up @@ -3748,7 +3748,7 @@ void ScriptViewXYZMINMAXOrtho(int command){
/* ------------------ ScriptViewXYZMINMAXPersp ------------------------ */
void ResetDefaultMenu(int var);
void ScriptViewXYZMINMAXPersp(int command){
switch (command){
switch(command){
case SCRIPT_VIEWXMIN:
ResetDefaultMenu(VIEW_XMIN);
break;
Expand Down
16 changes: 8 additions & 8 deletions Source/smokeview/IOslice.c
Original file line number Diff line number Diff line change
Expand Up @@ -1864,21 +1864,21 @@ void UpdateVectorSkip(int skip){
if(slicei->imap == NULL){
int *imap;

NewMemory(( void ** )&imap, (slicemesh->ibar + 1) * sizeof(int));
NewMemory((void **)&imap, (slicemesh->ibar + 1) * sizeof(int));
slicei->imap = imap;
slicei->n_imap = 0;
}
if(slicei->jmap == NULL){
int *jmap;

NewMemory(( void ** )&jmap, (slicemesh->jbar + 1) * sizeof(int));
NewMemory((void **)&jmap, (slicemesh->jbar + 1) * sizeof(int));
slicei->jmap = jmap;
slicei->n_jmap = 0;
}
if(slicei->kmap == NULL){
int *kmap;

NewMemory(( void ** )&kmap, (slicemesh->kbar + 1) * sizeof(int));
NewMemory((void **)&kmap, (slicemesh->kbar + 1) * sizeof(int));
slicei->kmap = kmap;
slicei->n_kmap = 0;
}
Expand Down Expand Up @@ -4184,8 +4184,8 @@ FILE_SIZE ReadSlice(const char *file, int ifile, int time_frame, float *time_val
qvalptrs = ( float **)sd->frameinfo->frameptrs;
#else
int i;
NewMemory(( void ** )&qvalptrs, sd->ntimes*sizeof(float *));
for(i=0; i< sd->ntimes ; i++){
NewMemory((void **)&qvalptrs, sd->ntimes*sizeof(float *));
for(i=0; i< sd->ntimes; i++){
qvalptrs[i] = sd->qslicedata + i*data_per_timestep;
}
#endif
Expand Down Expand Up @@ -4220,7 +4220,7 @@ FILE_SIZE ReadSlice(const char *file, int ifile, int time_frame, float *time_val

sd->sliceoffset = 0.0;

switch (sd->idir){
switch(sd->idir){
case XDIR:
offset = sliceoffset_factor*(xplt_local[1] - xplt_local[0]);
if(InBlockage(meshi, xslicemid - offset, yslicemid, zslicemid) == 1){
Expand Down Expand Up @@ -7409,7 +7409,7 @@ void DrawSliceFrame(){
slice_normal[2] = 0.0;
slicemesh = meshinfo+sd->blocknumber;
if(slicemesh->smokedir<0)direction = -1;
switch (ABS(slicemesh->smokedir)){
switch(ABS(slicemesh->smokedir)){
case 4: // -45 slope slices
visy_all = 1;
nslicemax = nploty_list;
Expand Down Expand Up @@ -9012,7 +9012,7 @@ void InitSliceData(void){
zplt[sd->ks1], zplt[sd->ks2]);


switch (sd->idir){
switch(sd->idir){
case XDIR:
fprintf(fileout, "%i\n", sd->ks2 + 1 - sd->ks1);
for(k = sd->ks1; k <= sd->ks2; k++){
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/IOvolsmoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ void MakeFireColors(float temp_min, float temp_max, int nfire_colors_arg){
#endif
dtemp = (temp_max - temp_min) / ( float )(nfire_colors_arg - 1);
FREEMEMORY(fire_rgbs);
NewMemory(( void ** )&fire_rgbs, 3*nfire_colors_arg*sizeof(float));
NewMemory((void **)&fire_rgbs, 3*nfire_colors_arg*sizeof(float));
for(i = 0; i < nfire_colors_arg; i++){
float temp, fire_emission[3];

Expand Down
4 changes: 2 additions & 2 deletions Source/smokeview/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ void MouseSelectGeom(int x, int y){
geomi = geominfoptrs[0];
geomlisti = geomi->geomlistinfo-1;

switch (select_geom){
switch(select_geom){
case GEOM_PROP_VERTEX1:
selected_geom_vertex1 = val-1;
break;
Expand Down Expand Up @@ -1659,7 +1659,7 @@ void Keyboard(unsigned char key, int flag){
// 2 device yes hrr no
// 3 device no hrr yes
// device plots
switch (plot_option){
switch(plot_option){
case DEVNO_HRRNO: // device plots off
case DEVNO_HRRYES:
vis_device_plot = DEVICE_PLOT_SHOW_ALL;
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/colortimebar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ void InitDefaultColorbars(int nini){
FREEMEMORY(colorbarinfo);
ncolorbars=ndefaultcolorbars;
NewMemory((void **)&colorbarinfo,(ncolorbars+nini)*sizeof(colorbardata));
NewMemory(( void ** )&colorbarcopyinfo, (ncolorbars + nini) * sizeof(colorbardata));
NewMemory((void **)&colorbarcopyinfo, (ncolorbars + nini) * sizeof(colorbardata));
UpdateCurrentColorbar(colorbarinfo + colorbartype);

for(i=0;i<ncolorbars;i++){
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/drawGeometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -3177,7 +3177,7 @@ void UpdateFaceLists(void){
if(nhidden>0){
n_normals_single=0;
for(iface=0;iface<meshi->nface_normals_single;iface++){
facedata *facei ;
facedata *facei;

facei=meshi->face_normals_single[iface];
if(facei->dup==0)meshi->face_normals_single[n_normals_single++]=facei;
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/getdatabounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int GetGlobalPartBounds(int flag){


if(part_bound_buffer == NULL && npartinfo > 0 && npart5prop>0){
NewMemory(( void ** )&part_bound_buffer, 2*npartinfo*npart5prop*sizeof(float));
NewMemory((void **)&part_bound_buffer, 2*npartinfo*npart5prop*sizeof(float));
for(i = 0; i < npartinfo; i++){
partdata *parti;
int j;
Expand Down
Loading

0 comments on commit 31b0de1

Please sign in to comment.