Changeset 455

Show
Ignore:
Timestamp:
10/25/09 13:36:03 (4 weeks ago)
Author:
cristy
Message:
 
Location:
ImageMagick/trunk
Files:
25 modified

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/magick/cache.c

    r453 r455  
    204204      (instantiate_cache == MagickFalse)) 
    205205    { 
    206       AcquireSemaphoreInfo(&cache_semaphore); 
     206      if (cache_semaphore == (SemaphoreInfo *) NULL) 
     207        AcquireSemaphoreInfo(&cache_semaphore); 
    207208      LockSemaphoreInfo(cache_semaphore); 
    208209      if ((cache_resources == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/magick/coder.c

    r453 r455  
    533533      (instantiate_coder == MagickFalse)) 
    534534    { 
    535       AcquireSemaphoreInfo(&coder_semaphore); 
     535      if (coder_semaphore == (SemaphoreInfo *) NULL) 
     536        AcquireSemaphoreInfo(&coder_semaphore); 
    536537      LockSemaphoreInfo(coder_semaphore); 
    537538      if ((coder_list == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/magick/color.c

    r453 r455  
    14571457      (instantiate_color == MagickFalse)) 
    14581458    { 
    1459       AcquireSemaphoreInfo(&color_semaphore); 
     1459      if (color_semaphore == (SemaphoreInfo *) NULL) 
     1460        AcquireSemaphoreInfo(&color_semaphore); 
    14601461      LockSemaphoreInfo(color_semaphore); 
    14611462      if ((color_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/configure.c

    r453 r455  
    869869      (instantiate_configure == MagickFalse)) 
    870870    { 
    871       AcquireSemaphoreInfo(&configure_semaphore); 
     871      if (configure_semaphore == (SemaphoreInfo *) NULL) 
     872        AcquireSemaphoreInfo(&configure_semaphore); 
    872873      LockSemaphoreInfo(configure_semaphore); 
    873874      if ((configure_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/constitute.c

    r453 r455  
    511511    } 
    512512  image=NewImageList(); 
     513  if (constitute_semaphore == (SemaphoreInfo *) NULL) 
     514    AcquireSemaphoreInfo(&constitute_semaphore); 
    513515  if ((magick_info != (const MagickInfo *) NULL) && 
    514516      (GetImageDecoder(magick_info) != (DecodeImageHandler *) NULL)) 
     
    516518      thread_support=GetMagickThreadSupport(magick_info); 
    517519      if ((thread_support & DecoderThreadSupport) == 0) 
    518         { 
    519           AcquireSemaphoreInfo(&constitute_semaphore); 
    520           LockSemaphoreInfo(constitute_semaphore); 
    521         } 
     520        LockSemaphoreInfo(constitute_semaphore); 
    522521      image=GetImageDecoder(magick_info)(read_info,exception); 
    523522      if ((thread_support & DecoderThreadSupport) == 0) 
     
    551550      *read_info->filename='\0'; 
    552551      if (GetDelegateThreadSupport(delegate_info) == MagickFalse) 
    553         { 
    554           AcquireSemaphoreInfo(&constitute_semaphore); 
    555           LockSemaphoreInfo(constitute_semaphore); 
    556         } 
     552        LockSemaphoreInfo(constitute_semaphore); 
    557553      (void) InvokeDelegate(read_info,image,read_info->magick,(char *) NULL, 
    558554        exception); 
     
    578574      thread_support=GetMagickThreadSupport(magick_info); 
    579575      if ((thread_support & DecoderThreadSupport) == 0) 
    580         { 
    581           AcquireSemaphoreInfo(&constitute_semaphore); 
    582           LockSemaphoreInfo(constitute_semaphore); 
    583         } 
     576        LockSemaphoreInfo(constitute_semaphore); 
    584577      image=(Image *) (GetImageDecoder(magick_info))(read_info,exception); 
    585578      if ((thread_support & DecoderThreadSupport) == 0) 
     
    11021095        } 
    11031096    } 
     1097  if (constitute_semaphore == (SemaphoreInfo *) NULL) 
     1098    AcquireSemaphoreInfo(&constitute_semaphore); 
    11041099  if ((magick_info != (const MagickInfo *) NULL) && 
    11051100      (GetImageEncoder(magick_info) != (EncodeImageHandler *) NULL)) 
     
    11101105      thread_support=GetMagickThreadSupport(magick_info); 
    11111106      if ((thread_support & EncoderThreadSupport) == 0) 
    1112         { 
    1113           AcquireSemaphoreInfo(&constitute_semaphore); 
    1114           LockSemaphoreInfo(constitute_semaphore); 
    1115         } 
     1107        LockSemaphoreInfo(constitute_semaphore); 
    11161108      status=GetImageEncoder(magick_info)(write_info,image); 
    11171109      if ((thread_support & EncoderThreadSupport) == 0) 
     
    11291121          *write_info->filename='\0'; 
    11301122          if (GetDelegateThreadSupport(delegate_info) == MagickFalse) 
    1131             { 
    1132               AcquireSemaphoreInfo(&constitute_semaphore); 
    1133               LockSemaphoreInfo(constitute_semaphore); 
    1134             } 
     1123            LockSemaphoreInfo(constitute_semaphore); 
    11351124          status=InvokeDelegate(write_info,image,(char *) NULL, 
    11361125            write_info->magick,&image->exception); 
     
    11631152              thread_support=GetMagickThreadSupport(magick_info); 
    11641153              if ((thread_support & EncoderThreadSupport) == 0) 
    1165                 { 
    1166                   AcquireSemaphoreInfo(&constitute_semaphore); 
    1167                   LockSemaphoreInfo(constitute_semaphore); 
    1168                 } 
     1154                LockSemaphoreInfo(constitute_semaphore); 
    11691155              status=GetImageEncoder(magick_info)(write_info,image); 
    11701156              if ((thread_support & EncoderThreadSupport) == 0) 
  • ImageMagick/trunk/magick/delegate.c

    r453 r455  
    709709      (instantiate_delegate == MagickFalse)) 
    710710    { 
    711       AcquireSemaphoreInfo(&delegate_semaphore); 
     711      if (delegate_semaphore == (SemaphoreInfo *) NULL) 
     712        AcquireSemaphoreInfo(&delegate_semaphore); 
    712713      LockSemaphoreInfo(delegate_semaphore); 
    713714      if ((delegate_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/locale.c

    r453 r455  
    550550      (instantiate_locale == MagickFalse)) 
    551551    { 
    552       AcquireSemaphoreInfo(&locale_semaphore); 
     552      if (locale_semaphore == (SemaphoreInfo *) NULL) 
     553        AcquireSemaphoreInfo(&locale_semaphore); 
    553554      LockSemaphoreInfo(locale_semaphore); 
    554555      if ((locale_list == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/magick/log.c

    r453 r455  
    531531  if ((log_list == (LinkedListInfo *) NULL) && (instantiate_log == MagickFalse)) 
    532532    { 
    533       AcquireSemaphoreInfo(&log_semaphore); 
     533      if (log_semaphore == (SemaphoreInfo *) NULL) 
     534        AcquireSemaphoreInfo(&log_semaphore); 
    534535      LockSemaphoreInfo(log_semaphore); 
    535536      if ((log_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/magic.c

    r453 r455  
    523523      (instantiate_magic == MagickFalse)) 
    524524    { 
    525       AcquireSemaphoreInfo(&magic_semaphore); 
     525      if (magic_semaphore == (SemaphoreInfo *) NULL) 
     526        AcquireSemaphoreInfo(&magic_semaphore); 
    526527      LockSemaphoreInfo(magic_semaphore); 
    527528      if ((magic_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/magick.c

    r453 r455  
    776776      (instantiate_magick == MagickFalse)) 
    777777    { 
    778       AcquireSemaphoreInfo(&magick_semaphore); 
     778      if (magick_semaphore == (SemaphoreInfo *) NULL) 
     779        AcquireSemaphoreInfo(&magick_semaphore); 
    779780      LockSemaphoreInfo(magick_semaphore); 
    780781      if ((magick_list == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/magick/mime.c

    r453 r455  
    605605      (instantiate_mime == MagickFalse)) 
    606606    { 
    607       AcquireSemaphoreInfo(&mime_semaphore); 
     607      if (mime_semaphore == (SemaphoreInfo *) NULL) 
     608        AcquireSemaphoreInfo(&mime_semaphore); 
    608609      LockSemaphoreInfo(mime_semaphore); 
    609610      if ((mime_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/module.c

    r453 r455  
    848848      (instantiate_module == MagickFalse)) 
    849849    { 
    850       AcquireSemaphoreInfo(&module_semaphore); 
     850      if (module_semaphore == (SemaphoreInfo *) NULL) 
     851        AcquireSemaphoreInfo(&module_semaphore); 
    851852      LockSemaphoreInfo(module_semaphore); 
    852853      if ((module_list == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/magick/policy.c

    r453 r455  
    429429      (instantiate_policy == MagickFalse)) 
    430430    { 
    431       AcquireSemaphoreInfo(&policy_semaphore); 
     431      if (policy_semaphore == (SemaphoreInfo *) NULL) 
     432        AcquireSemaphoreInfo(&policy_semaphore); 
    432433      LockSemaphoreInfo(policy_semaphore); 
    433434      if ((policy_list == (LinkedListInfo *) NULL) && 
  • ImageMagick/trunk/magick/registry.c

    r453 r455  
    526526      (instantiate_registry == MagickFalse)) 
    527527    { 
    528       AcquireSemaphoreInfo(&registry_semaphore); 
     528      if (registry_semaphore == (SemaphoreInfo *) NULL) 
     529        AcquireSemaphoreInfo(&registry_semaphore); 
    529530      LockSemaphoreInfo(registry_semaphore); 
    530531      if ((registry == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/magick/type.c

    r453 r455  
    772772      (instantiate_type == MagickFalse)) 
    773773    { 
    774       AcquireSemaphoreInfo(&type_semaphore); 
     774      if (type_semaphore == (SemaphoreInfo *) NULL) 
     775        AcquireSemaphoreInfo(&type_semaphore); 
    775776      LockSemaphoreInfo(type_semaphore); 
    776777      if ((type_list == (SplayTreeInfo *) NULL) && 
  • ImageMagick/trunk/utilities/animate.c

    r451 r455  
    8585int main(int argc,char **argv) 
    8686{ 
    87   char 
    88     *metadata; 
    89  
    9087  ExceptionInfo 
    9188    *exception; 
     
    10097  exception=AcquireExceptionInfo(); 
    10198  image_info=AcquireImageInfo(); 
    102   metadata=(char *) NULL; 
    10399  status=MagickCommandGenesis(image_info,AnimateImageCommand,argc,argv, 
    104     &metadata,exception); 
    105   if (metadata != (char *) NULL) 
    106     metadata=DestroyString(metadata); 
     100    (char **) NULL,exception); 
    107101  image_info=DestroyImageInfo(image_info); 
    108102  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/composite.c

    r451 r455  
    6060int main(int argc,char **argv) 
    6161{ 
    62   char 
    63     *metadata; 
    64  
    6562  ExceptionInfo 
    6663    *exception; 
     
    7572  exception=AcquireExceptionInfo(); 
    7673  image_info=AcquireImageInfo(); 
    77   metadata=(char *) NULL; 
    7874  status=MagickCommandGenesis(image_info,CompositeImageCommand,argc,argv, 
    79     &metadata,exception); 
    80   if (metadata != (char *) NULL) 
    81     metadata=DestroyString(metadata); 
     75    (char **) NULL,exception); 
    8276  image_info=DestroyImageInfo(image_info); 
    8377  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/conjure.c

    r451 r455  
    7979int main(int argc,char **argv) 
    8080{ 
    81   char 
    82     *metadata; 
    83  
    8481  ExceptionInfo 
    8582    *exception; 
     
    9491  exception=AcquireExceptionInfo(); 
    9592  image_info=AcquireImageInfo(); 
    96   metadata=(char *) NULL; 
    9793  status=MagickCommandGenesis(image_info,ConjureImageCommand,argc,argv, 
    98     &metadata,exception); 
    99   if (metadata != (char *) NULL) 
    100     metadata=DestroyString(metadata); 
     94    (char **) NULL,exception); 
    10195  image_info=DestroyImageInfo(image_info); 
    10296  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/convert.c

    r451 r455  
    6666int main(int argc,char **argv) 
    6767{ 
    68   char 
    69     *metadata; 
    70  
    7168  ExceptionInfo 
    7269    *exception; 
     
    8178  exception=AcquireExceptionInfo(); 
    8279  image_info=AcquireImageInfo(); 
    83   metadata=(char *) NULL; 
    8480  status=MagickCommandGenesis(image_info,ConvertImageCommand,argc,argv, 
    85     &metadata,exception); 
    86   if (metadata != (char *) NULL) 
    87     metadata=DestroyString(metadata); 
     81    (char **) NULL,exception); 
    8882  image_info=DestroyImageInfo(image_info); 
    8983  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/display.c

    r451 r455  
    9090int main(int argc,char **argv) 
    9191{ 
    92   char 
    93     *metadata; 
    94  
    9592  ExceptionInfo 
    9693    *exception; 
     
    105102  exception=AcquireExceptionInfo(); 
    106103  image_info=AcquireImageInfo(); 
    107   metadata=(char *) NULL; 
    108104  status=MagickCommandGenesis(image_info,DisplayImageCommand,argc,argv, 
    109     &metadata,exception); 
    110   if (metadata != (char *) NULL) 
    111     metadata=DestroyString(metadata); 
     105    (char **) NULL,exception); 
    112106  image_info=DestroyImageInfo(image_info); 
    113107  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/import.c

    r451 r455  
    8282int main(int argc,char **argv) 
    8383{ 
    84   char 
    85     *metadata; 
    86  
    8784  ExceptionInfo 
    8885    *exception; 
     
    9794  exception=AcquireExceptionInfo(); 
    9895  image_info=AcquireImageInfo(); 
    99   metadata=(char *) NULL; 
    10096  status=MagickCommandGenesis(image_info,ImportImageCommand,argc,argv, 
    101     &metadata,exception); 
    102   if (metadata != (char *) NULL) 
    103     metadata=DestroyString(metadata); 
     97    (char *) NULL,exception); 
    10498  image_info=DestroyImageInfo(image_info); 
    10599  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/mogrify.c

    r451 r455  
    6262int main(int argc,char **argv) 
    6363{ 
    64   char 
    65     *metadata; 
    66  
    6764  ExceptionInfo 
    6865    *exception; 
     
    7774  exception=AcquireExceptionInfo(); 
    7875  image_info=AcquireImageInfo(); 
    79   metadata=(char *) NULL; 
    8076  status=MagickCommandGenesis(image_info,ImportImageCommand,argc,argv, 
    81     &metadata,exception); 
    82   if (metadata != (char *) NULL) 
    83     metadata=DestroyString(metadata); 
     77    (char **) NULL,exception); 
    8478  image_info=DestroyImageInfo(image_info); 
    8579  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/montage.c

    r451 r455  
    6262int main(int argc,char **argv) 
    6363{ 
    64   char 
    65     *metadata; 
    66  
    6764  ExceptionInfo 
    6865    *exception; 
     
    7774  exception=AcquireExceptionInfo(); 
    7875  image_info=AcquireImageInfo(); 
    79   metadata=(char *) NULL; 
    8076  status=MagickCommandGenesis(image_info,MontageImageCommand,argc,argv, 
    81     &metadata,exception); 
    82   if (metadata != (char *) NULL) 
    83     metadata=DestroyString(metadata); 
     77    (char **) NULL,exception); 
    8478  image_info=DestroyImageInfo(image_info); 
    8579  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/utilities/stream.c

    r451 r455  
    6262int main(int argc,char **argv) 
    6363{ 
    64   char 
    65     *metadata; 
    66  
    6764  ExceptionInfo 
    6865    *exception; 
     
    7774  exception=AcquireExceptionInfo(); 
    7875  image_info=AcquireImageInfo(); 
    79   metadata=(char *) NULL; 
    8076  status=MagickCommandGenesis(image_info,StreamImageCommand,argc,argv, 
    81     &metadata,exception); 
    82   if (metadata != (char *) NULL) 
    83     metadata=DestroyString(metadata); 
     77    (char **) NULL,exception); 
    8478  image_info=DestroyImageInfo(image_info); 
    8579  exception=DestroyExceptionInfo(exception); 
  • ImageMagick/trunk/wand/mogrify.c

    r451 r455  
    183183            CatchException(exception); 
    184184          } 
    185         if (*metadata != (char *) NULL) 
     185        if ((metadata != (char *) NULL) && (*metadata != (char *) NULL)) 
    186186          { 
    187187            (void) fputs(*metadata,stdout);