Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/stdio/src/FibreIO/ScanStringArr.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ void FibreScanStringArray( SAC_ND_PARAM_out( resout_nt, array *), FILE *stream)
array *SAC_ND_A_FIELD( res_nt );
int size;
int i;

SAC_ND_ALLOC__DESC( res_nt, 0);
SAC_ND_SET__RC( res_nt, 1);

char* s;

start_token = PARSE_STRING_ARRAY;
doScan( stream);
Expand All @@ -35,14 +32,18 @@ void FibreScanStringArray( SAC_ND_PARAM_out( resout_nt, array *), FILE *stream)
}

res = SAC_StringArray_alloc( dims, size);

for( i=0; i < dims; i++) {
res->shp[i] = shape[i];
}

res->data = stringarray;

SAC_ND_ALLOC__DESC( res_nt, 0);
SAC_ND_SET__RC( res_nt, 1);

for( i=0; i < size ; i++) {
s = stringarray[i];
SAC_ND_DECL__DESC( s_nt, );
SAC_ND_ALLOC__DESC( s_nt, 0);
SAC_ND_SET__RC( s_nt, 1);
Expand All @@ -68,10 +69,7 @@ void FibreScanStringArrayStr( SAC_ND_PARAM_out( resout_nt, array *), char *strea
array *SAC_ND_A_FIELD( res_nt );
int size;
int i;

SAC_ND_ALLOC__DESC( res_nt, 0);
SAC_ND_SET__RC( res_nt, 1);

char* s;

start_token = PARSE_STRING_ARRAY;
yy_scan_string( stream);
Expand All @@ -90,7 +88,11 @@ void FibreScanStringArrayStr( SAC_ND_PARAM_out( resout_nt, array *), char *strea

res->data = stringarray;

SAC_ND_ALLOC__DESC( res_nt, 0);
SAC_ND_SET__RC( res_nt, 1);

for( i=0; i < size ; i++) {
s = stringarray[i];
SAC_ND_DECL__DESC( s_nt, );
SAC_ND_ALLOC__DESC( s_nt, 0);
SAC_ND_SET__RC( s_nt, 1);
Expand Down
6 changes: 4 additions & 2 deletions src/stdio/src/File/mkstemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ int SACmkstemp ( SAC_ND_PARAM_out_nodesc (filep_nt, FILE*),
// initialise filep
SAC_ND_A_FIELD (filep_nt) = NULL;

// alloc string descriptor and string
SAC_ND_ALLOC__DESC (str_nt, 0)
// alloc string
SAC_ND_SET__RC (str_nt, 1)
SAC_ND_A_FIELD (str_nt) = SAC_MALLOC (length + 1);

Expand All @@ -46,6 +45,9 @@ int SACmkstemp ( SAC_ND_PARAM_out_nodesc (filep_nt, FILE*),
error = errno;
}
}
// alloc string descriptor
SAC_ND_ALLOC__DESC (str_nt, 0)


SAC_ND_RET_out__NODESC (filep_nt, filep_nt)
SAC_ND_RET_out (str_nt, str_nt)
Expand Down
6 changes: 3 additions & 3 deletions src/structures/src/StringArray/genarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ void SAC_StringArray_genarray( SAC_ND_PARAM_out( resout_nt, array *),
int dim, size;
int i;

SAC_ND_ALLOC__DESC( res_nt, 0);
SAC_ND_SET__RC( res_nt, 1);

dim = SAC_ND_A_DESC_SIZE( shp_nt );
size = 1;
for( i=0; i < dim; i++) {
Expand All @@ -28,6 +25,9 @@ void SAC_StringArray_genarray( SAC_ND_PARAM_out( resout_nt, array *),

res = SAC_StringArray_alloc( dim, size);

SAC_ND_ALLOC__DESC( res_nt, 0);
SAC_ND_SET__RC( res_nt, 1);

for( i=0; i < dim; i++) {
res->shp[i] = SAC_ND_READ( shp_nt, i);
}
Expand Down
Loading