"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Basic/Core/pdlutil.c" between
PDL-2.075.tar.gz and PDL-2.076.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

pdlutil.c  (PDL-2.075):pdlutil.c  (PDL-2.076)
skipping to change at line 26 skipping to change at line 26
return; \ return; \
} \ } \
for(i=0; i<nspac; i++) spaces[i]=' '; \ for(i=0; i<nspac; i++) spaces[i]=' '; \
spaces[i] = '\0'; \ spaces[i] = '\0'; \
} while (0) } while (0)
#define psp printf("%s",spaces) #define psp printf("%s",spaces)
/* modified from glibc printf(3) */ /* modified from glibc printf(3) */
pdl_error pdl_make_error(pdl_error_type e, const char *fmt, ...) { pdl_error pdl_make_error(pdl_error_type e, const char *fmt, ...) {
pdl_error PDL_err = {PDL_EFATAL, "make_error problem", 0}; pdl_error PDL_err = {PDL_EFATAL, "make_error problem", 0};
PDLDEBUG_f(printf("pdl_make_error called: "));
va_list ap; va_list ap;
/* Determine required size */ /* Determine required size */
va_start(ap, fmt); va_start(ap, fmt);
int size = vsnprintf(NULL, 0, fmt, ap); int size = vsnprintf(NULL, 0, fmt, ap);
va_end(ap); va_end(ap);
if (size < 0) return PDL_err; if (size < 0) return PDL_err;
char needs_free = 1; char needs_free = 1;
char *p = NULL; char *p = NULL;
if (pdl_pthread_main_thread()) { if (pdl_pthread_main_thread()) {
size++; /* For '\0' */ size++; /* For '\0' */
skipping to change at line 52 skipping to change at line 53
free(p); free(p);
return PDL_err; return PDL_err;
} }
} else { } else {
size_t len = 0; size_t len = 0;
va_start(ap, fmt); va_start(ap, fmt);
pdl_pthread_realloc_vsnprintf(&p, &len, size, fmt, &ap, 0); pdl_pthread_realloc_vsnprintf(&p, &len, size, fmt, &ap, 0);
va_end(ap); va_end(ap);
needs_free = 2; needs_free = 2;
} }
PDLDEBUG_f(printf("%s\n", p));
return (pdl_error){e, p, needs_free}; return (pdl_error){e, p, needs_free};
} }
pdl_error pdl_make_error_simple(pdl_error_type e, const char *msg) { pdl_error pdl_make_error_simple(pdl_error_type e, const char *msg) {
pdl_error PDL_err = {e, msg, 0}; pdl_error PDL_err = {e, msg, 0};
return PDL_err; return PDL_err;
} }
pdl_error pdl_croak_param(pdl_transvtable *vtable,int paramIndex, char *pat, ... ) pdl_error pdl_croak_param(pdl_transvtable *vtable,int paramIndex, char *pat, ... )
{ {
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)