Skip to content

Commit ff310c7

Browse files
[Janitor mode] Fix whitespace
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20443 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent c6d05d8 commit ff310c7

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

Compiler/runtime/HpcOmBenchmarkExt.cpp

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -336,52 +336,52 @@ class XmlBenchReader {
336336

337337
std::list<std::list<double> > ReadJsonBenchFileEquations(std::string filePath)
338338
{
339-
std::list<std::list<double> > resultList = std::list<std::list<double> >();
340-
341-
FILE *fp;
342-
long lSize;
343-
char *buffer;
344-
int arraySize, i;
345-
cJSON *root;
346-
cJSON *profileBlocks;
347-
348-
fp = fopen ( filePath.c_str() , "rb" );
349-
if( !fp ) perror(filePath.c_str()),exit(1);
350-
351-
fseek( fp , 0L , SEEK_END);
352-
lSize = ftell( fp );
353-
rewind( fp );
354-
355-
/* allocate memory for entire content */
356-
buffer = (char*)calloc( 1, lSize+1 );
357-
if( !buffer ) fclose(fp),fputs("memory alloc fails",stderr),exit(1);
358-
359-
/* copy the file into the buffer */
360-
if( 1!=fread( buffer , lSize, 1 , fp) )
361-
fclose(fp),free(buffer),fputs("entire read fails",stderr),exit(1);
362-
363-
/* do your work here, buffer is a string contains the whole text */
364-
root = cJSON_Parse(buffer);
365-
profileBlocks = cJSON_GetObjectItem(root,"profileBlocks");
366-
arraySize = cJSON_GetArraySize(profileBlocks);
367-
for(i = 0; i < arraySize; i++)
368-
{
369-
cJSON *item = cJSON_GetArrayItem(profileBlocks, i);
370-
cJSON *idItem = cJSON_GetObjectItem(item, "id");
371-
cJSON *ncallItem = cJSON_GetObjectItem(item, "ncall");
372-
cJSON *timeItem = cJSON_GetObjectItem(item, "time");
373-
std::list<double> tmpLst = std::list<double>();
374-
375-
tmpLst.push_back(idItem->valuedouble);
376-
tmpLst.push_back(timeItem->valuedouble);
377-
tmpLst.push_back(ncallItem->valuedouble);
378-
resultList.push_back(tmpLst);
379-
}
380-
381-
fclose(fp);
382-
free(buffer);
383-
384-
return resultList;
339+
std::list<std::list<double> > resultList = std::list<std::list<double> >();
340+
341+
FILE *fp;
342+
long lSize;
343+
char *buffer;
344+
int arraySize, i;
345+
cJSON *root;
346+
cJSON *profileBlocks;
347+
348+
fp = fopen ( filePath.c_str() , "rb" );
349+
if( !fp ) perror(filePath.c_str()),exit(1);
350+
351+
fseek( fp , 0L , SEEK_END);
352+
lSize = ftell( fp );
353+
rewind( fp );
354+
355+
/* allocate memory for entire content */
356+
buffer = (char*)calloc( 1, lSize+1 );
357+
if( !buffer ) fclose(fp),fputs("memory alloc fails",stderr),exit(1);
358+
359+
/* copy the file into the buffer */
360+
if( 1!=fread( buffer , lSize, 1 , fp) )
361+
fclose(fp),free(buffer),fputs("entire read fails",stderr),exit(1);
362+
363+
/* do your work here, buffer is a string contains the whole text */
364+
root = cJSON_Parse(buffer);
365+
profileBlocks = cJSON_GetObjectItem(root,"profileBlocks");
366+
arraySize = cJSON_GetArraySize(profileBlocks);
367+
for(i = 0; i < arraySize; i++)
368+
{
369+
cJSON *item = cJSON_GetArrayItem(profileBlocks, i);
370+
cJSON *idItem = cJSON_GetObjectItem(item, "id");
371+
cJSON *ncallItem = cJSON_GetObjectItem(item, "ncall");
372+
cJSON *timeItem = cJSON_GetObjectItem(item, "time");
373+
std::list<double> tmpLst = std::list<double>();
374+
375+
tmpLst.push_back(idItem->valuedouble);
376+
tmpLst.push_back(timeItem->valuedouble);
377+
tmpLst.push_back(ncallItem->valuedouble);
378+
resultList.push_back(tmpLst);
379+
}
380+
381+
fclose(fp);
382+
free(buffer);
383+
384+
return resultList;
385385
}
386386

387387
void* HpcOmBenchmarkExtImpl__readCalcTimesFromXml(const char *filename)

0 commit comments

Comments
 (0)