"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Basic/Core/pdlapi.c" between
PDL-2.082.tar.gz and PDL-2.083.tar.gz

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

pdlapi.c  (PDL-2.082):pdlapi.c  (PDL-2.083)
skipping to change at line 336 skipping to change at line 336
pdl_error pdl__destroy_recprotect(pdl *it, int recurse_count); pdl_error pdl__destroy_recprotect(pdl *it, int recurse_count);
pdl_error pdl_destroytransform(pdl_trans *trans,int ensure,int *wd, int recurse_ count) pdl_error pdl_destroytransform(pdl_trans *trans,int ensure,int *wd, int recurse_ count)
{ {
pdl_error PDL_err = {0, NULL, 0}; pdl_error PDL_err = {0, NULL, 0};
PDL_TR_CHKMAGIC(trans); PDL_TR_CHKMAGIC(trans);
PDL_Indx j; PDL_Indx j;
int ismutual = (trans->flags & PDL_ITRANS_DO_DATAFLOW_ANY); int ismutual = (trans->flags & PDL_ITRANS_DO_DATAFLOW_ANY);
if (!trans->vtable) if (!trans->vtable)
return pdl_make_error(PDL_EFATAL, "ZERO VTABLE DESTTRAN 0x%p %d\n ",trans,ensure); return pdl_make_error(PDL_EFATAL, "ZERO VTABLE DESTTRAN 0x%p %d\n ",trans,ensure);
if (!ismutual) for(j=0; j<trans->vtable->nparents; j++) if (!ismutual) for(j=0; j<trans->vtable->nparents; j++)
if (!trans->pdls[j]) return pdl_make_error(PDL_EFATAL, "NULL pdls[%td] in %s", j, trans->vtable->name); else
if (trans->pdls[j]->state & PDL_DATAFLOW_ANY) { ismutual=1; break; } if (trans->pdls[j]->state & PDL_DATAFLOW_ANY) { ismutual=1; break; }
PDLDEBUG_f(printf("pdl_destroytransform %s=%p (ensure=%d ismutual=%d)\n", PDLDEBUG_f(printf("pdl_destroytransform %s=%p (ensure=%d ismutual=%d)\n",
trans->vtable ? trans->vtable->name : "NULL", trans->vtable->name,
(void*)trans,ensure,ismutual)); (void*)trans,ensure,ismutual));
if(ensure) if(ensure)
PDL_ACCUMERROR(PDL_err, pdl__ensure_trans(trans,ismutual ? 0 : PD L_PARENTDIMSCHANGED,wd, recurse_count+1)); PDL_ACCUMERROR(PDL_err, pdl__ensure_trans(trans,ismutual ? 0 : PD L_PARENTDIMSCHANGED,wd, recurse_count+1));
pdl *destbuffer[trans->vtable->npdls]; pdl *destbuffer[trans->vtable->npdls];
int ndest = 0; int ndest = 0;
for(j=0; j<trans->vtable->nparents; j++) { for(j=0; j<trans->vtable->nparents; j++) {
pdl *parent = trans->pdls[j]; pdl *parent = trans->pdls[j];
if(!parent) continue; if(!parent) continue;
PDL_CHKMAGIC(parent); PDL_CHKMAGIC(parent);
pdl__removetrans_children(parent,trans); pdl__removetrans_children(parent,trans);
skipping to change at line 460 skipping to change at line 461
it->state &= ~PDL_DESTROYING; it->state &= ~PDL_DESTROYING;
return PDL_err; return PDL_err;
} }
pdl_error pdl_destroy(pdl *it) { pdl_error pdl_destroy(pdl *it) {
return pdl__destroy_recprotect(it, 0); return pdl__destroy_recprotect(it, 0);
} }
/* Straight copy, no dataflow */ /* Straight copy, no dataflow */
pdl *pdl_hard_copy(pdl *src) { pdl *pdl_hard_copy(pdl *src) {
PDLDEBUG_f(printf("pdl_hard_copy (src=%p): ", src));
pdl_error PDL_err = pdl_make_physical(src); /* Wasteful XXX... should be lazier */ pdl_error PDL_err = pdl_make_physical(src); /* Wasteful XXX... should be lazier */
if (PDL_err.error) return NULL; if (PDL_err.error) return NULL;
int i; int i;
PDLDEBUG_f(printf("pdl_hard_copy\n"));
pdl *it = pdl_pdlnew(); pdl *it = pdl_pdlnew();
if (!it) return it; if (!it) return it;
it->state = 0; it->state = 0;
PDLDEBUG_f(printf("pdl_hard_copy (%p): ", src);pdl_dump(it)); PDLDEBUG_f(printf("pdl_hard_copy (src=%p): ", src);pdl_dump(it));
it->datatype = src->datatype; it->datatype = src->datatype;
PDL_err = pdl_setdims(it,src->dims,src->ndims); PDL_err = pdl_setdims(it,src->dims,src->ndims);
if (PDL_err.error) { pdl_destroy(it); return NULL; } if (PDL_err.error) { pdl_destroy(it); return NULL; }
PDL_err = pdl_allocdata(it); PDL_err = pdl_allocdata(it);
if (PDL_err.error) { pdl_destroy(it); return NULL; } if (PDL_err.error) { pdl_destroy(it); return NULL; }
if(src->state & PDL_NOMYDIMS) if(src->state & PDL_NOMYDIMS)
it->state |= PDL_NOMYDIMS; it->state |= PDL_NOMYDIMS;
PDL_err = pdl_reallocbroadcastids(it,src->nbroadcastids); PDL_err = pdl_reallocbroadcastids(it,src->nbroadcastids);
if (PDL_err.error) { pdl_destroy(it); return NULL; } if (PDL_err.error) { pdl_destroy(it); return NULL; }
for(i=0; i<src->nbroadcastids; i++) { for(i=0; i<src->nbroadcastids; i++) {
skipping to change at line 609 skipping to change at line 610
if (!c) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n"); if (!c) return pdl_make_error_simple(PDL_EFATAL, "Out of Memory\n");
c->trans[0] = trans; c->trans[0] = trans;
for(i=1; i<PDL_NCHILDREN; i++) for(i=1; i<PDL_NCHILDREN; i++)
c->trans[i] = 0; c->trans[i] = 0;
c->next = 0; c->next = 0;
return PDL_err; return PDL_err;
} }
pdl_error pdl_make_physdims(pdl *it) { pdl_error pdl_make_physdims(pdl *it) {
pdl_error PDL_err = {0, NULL, 0}; pdl_error PDL_err = {0, NULL, 0};
if (!it) return pdl_make_error_simple(PDL_EFATAL, "make_physdims called w ith NULL");
PDL_Indx i; PDL_Indx i;
int c = (it->state & PDL_PARENTDIMSCHANGED); int c = (it->state & PDL_PARENTDIMSCHANGED);
PDLDEBUG_f(printf("make_physdims %p (%X)\n",(void*)it, c)); PDLDEBUG_f(printf("make_physdims %p (%X)\n",(void*)it, c));
PDL_CHKMAGIC(it); PDL_CHKMAGIC(it);
if(!c) { if(!c) {
PDLDEBUG_f(printf("make_physdims exit (NOP) %p\n",(void*)it)); PDLDEBUG_f(printf("make_physdims exit (NOP) %p\n",(void*)it));
return PDL_err; return PDL_err;
} }
it->state &= ~PDL_PARENTDIMSCHANGED; it->state &= ~PDL_PARENTDIMSCHANGED;
pdl_trans *trans = it->trans_parent; pdl_trans *trans = it->trans_parent;
 End of changes. 6 change blocks. 
3 lines changed or deleted 5 lines changed or added

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