Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/lib/common/image.c
ViewVC logotype

Diff of /branches/vis12-cl/src/lib/common/image.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3080, Mon Mar 16 22:01:42 2015 UTC revision 3081, Mon Mar 16 22:08:21 2015 UTC
# Line 345  Line 345 
345  }  }
346    
347  /* free image */  /* free image */
348  bool Diderot_FreeImage1D (WorldPrefix_t *wrld, Diderot_image1D_t *img)  void Diderot_FreeImage1D (WorldPrefix_t *wrld, Diderot_image1D_t *img)
349  {  {
350      FREE (img->data);  /* border control currently causes multiple calls to FreeImage.  This test is a hack to
351     * try to avoid the problem until the compiler gets smarter.  We cannot directly do the
352     * update to img->data, since the optimizer knows about free.
353     */
354        void *data = img->data;
355        if (data == 0)
356            return;
357        img->data = 0;  /* border control hack */
358        FREE (data);
359      FREE (img);      FREE (img);
     return false;  
360  }  }
361    
362  bool Diderot_SetImage2D (WorldPrefix_t *wrld, const Nrrd *nin, Diderot_image2D_t **imgOut)  bool Diderot_SetImage2D (WorldPrefix_t *wrld, const Nrrd *nin, Diderot_image2D_t **imgOut)
# Line 423  Line 430 
430  }  }
431    
432  /* free image */  /* free image */
433  bool Diderot_FreeImage2D (WorldPrefix_t *wrld, Diderot_image2D_t *img)  void Diderot_FreeImage2D (WorldPrefix_t *wrld, Diderot_image2D_t *img)
434  {  {
435      FREE (img->data);  /* border control currently causes multiple calls to FreeImage.  This test is a hack to
436     * try to avoid the problem until the compiler gets smarter.  We cannot directly do the
437     * update to img->data, since the optimizer knows about free.
438     */
439        void *data = img->data;
440        if (data == 0)
441            return;
442        img->data = 0;  /* border control hack */
443        FREE (data);
444      FREE (img);      FREE (img);
     return false;  
445  }  }
446    
447  bool Diderot_SetImage3D (WorldPrefix_t *wrld, const Nrrd *nin, Diderot_image3D_t **imgOut)  bool Diderot_SetImage3D (WorldPrefix_t *wrld, const Nrrd *nin, Diderot_image3D_t **imgOut)
# Line 503  Line 517 
517  }  }
518    
519  /* free image */  /* free image */
520  bool Diderot_FreeImage3D (WorldPrefix_t *wrld, Diderot_image3D_t *img)  void Diderot_FreeImage3D (WorldPrefix_t *wrld, Diderot_image3D_t *img)
521  {  {
522      FREE (img->data);  /* border control currently causes multiple calls to FreeImage.  This test is a hack to
523     * try to avoid the problem until the compiler gets smarter.  We cannot directly do the
524     * update to img->data, since the optimizer knows about free.
525     */
526        void *data = img->data;
527        if (data == 0)
528            return;
529        img->data = 0;  /* border control hack */
530        FREE (data);
531      FREE (img);      FREE (img);
     return false;  
532  }  }

Legend:
Removed from v.3080  
changed lines
  Added in v.3081

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0