Changeset 15338 for trunk/Compiler/runtime/printimpl.c
- Timestamp:
- 2013-02-26T16:43:56+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/runtime/printimpl.c
r15318 r15338 36 36 #include "systemimpl.h" 37 37 38 /* adrpo: this is defined in errorext. (enabled with omc +showErrorMessages) */ 39 extern int showErrorMessages; 38 /* adrpo: "int showErrorMessages" is defined in errorext. (enabled with omc +showErrorMessages) */ 40 39 41 40 #define GROWTH_FACTOR 1.4 /* According to some rumors of buffer growth */ … … 50 49 #define errorCursize Print_var_errorCursize 51 50 52 char *buf = NULL;53 char *errorBuf = NULL;54 55 int nfilled=0;56 int cursize=0;57 58 int errorNfilled=0;59 int errorCursize=0;60 61 char** savedBuffers=0;62 long* savedCurSize;63 long* savedNfilled;51 static char *buf = NULL; 52 static char *errorBuf = NULL; 53 54 static int nfilled=0; 55 static int cursize=0; 56 57 static int errorNfilled=0; 58 static int errorCursize=0; 59 60 static char** savedBuffers=0; 61 static long* savedCurSize; 62 static long* savedNfilled; 64 63 65 64 static int increase_buffer(void) … … 136 135 } 137 136 138 int print_error_buf_impl(const char *str)137 static int print_error_buf_impl(const char *str) 139 138 { 140 139 /* printf("cursize: %d, nfilled %d, strlen: %d\n",cursize,nfilled,strlen(str));*/ … … 242 241 243 242 /* returns NULL on failure */ 244 const char* PrintImpl__getString(void)243 static const char* PrintImpl__getString(void) 245 244 { 246 245 if(buf == NULL || buf[0]=='\0' || cursize==0){ … … 360 359 savedCurSize[handle] = 0; 361 360 savedNfilled[handle] = 0; 362 if (buf == 0) { 361 if (buf == 0) { 363 362 fprintf(stderr,"Internal error, handle %d does not contain a valid buffer pointer\n",handle); 364 363 return 1; … … 372 371 long freeHandle,foundHandle=0; 373 372 374 if (! savedBuffers) { 373 if (! savedBuffers) { 375 374 savedBuffers = (char**)malloc(MAXSAVEDBUFFERS*sizeof(char*)); 376 if (!savedBuffers) { 375 if (!savedBuffers) { 377 376 fprintf(stderr, "Internal error allocating savedBuffers in Print.saveAndClearBuf\n"); 378 377 return -1; … … 380 379 memset(savedBuffers,0,MAXSAVEDBUFFERS); 381 380 } 382 if (! savedCurSize) { 381 if (! savedCurSize) { 383 382 savedCurSize = (long*)malloc(MAXSAVEDBUFFERS*sizeof(long*)); 384 if (!savedCurSize) { 383 if (!savedCurSize) { 385 384 fprintf(stderr, "Internal error allocating savedCurSize in Print.saveAndClearBuf\n"); 386 385 return -1; … … 388 387 memset(savedCurSize,0,MAXSAVEDBUFFERS); 389 388 } 390 if (! savedNfilled) { 389 if (! savedNfilled) { 391 390 savedNfilled = (long*)malloc(MAXSAVEDBUFFERS*sizeof(long*)); 392 if (!savedNfilled) { 391 if (!savedNfilled) { 393 392 fprintf(stderr, "Internal error allocating savedNfilled in Print.saveAndClearBuf\n"); 394 393 return -1;
Note: See TracChangeset
for help on using the changeset viewer.