]> granicus.if.org Git - imagemagick/commitdiff
Fixed compiler warnings.
authordirk <dirk@git.imagemagick.org>
Sun, 1 Dec 2013 10:43:43 +0000 (10:43 +0000)
committerdirk <dirk@git.imagemagick.org>
Sun, 1 Dec 2013 10:43:43 +0000 (10:43 +0000)
MagickCore/accelerate.c
MagickCore/opencl.c

index 342b23004187fb1ec3d15303fabecabcfb394852..357536316a6e777cdd662822a3a5713dc6539ce4 100644 (file)
@@ -113,7 +113,7 @@ static MagickBooleanType checkOpenCLEnvironment(ExceptionInfo* exception)
 }
 
 
-static MagickBooleanType checkAccelerateCondition(const Image* image, const ChannelType channel, ExceptionInfo *exception) 
+static MagickBooleanType checkAccelerateCondition(const Image* image, const ChannelType channel)
 {
   /* check if the image's colorspace is supported */
   if (image->colorspace != RGBColorspace
@@ -473,7 +473,7 @@ MagickExport Image* AccelerateConvolveImageChannel(const Image *image, const Cha
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, channel, exception);
+  status = checkAccelerateCondition(image, channel);
   if (status == MagickFalse)
     return NULL;
 
@@ -645,7 +645,7 @@ MagickExport MagickBooleanType
   status = checkOpenCLEnvironment(exception);
   if (status == MagickTrue)
   {
-    status = checkAccelerateCondition(image, channel, exception);
+    status = checkAccelerateCondition(image, channel);
     if (status == MagickTrue)
     {
       status = ComputeFunctionImage(image, channel, function, number_parameters, parameters, exception);
@@ -1369,7 +1369,7 @@ Image* AccelerateBlurImage(const Image *image, const ChannelType channel, const
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, channel, exception);
+  status = checkAccelerateCondition(image, channel);
   if (status == MagickFalse)
     return NULL;
 
@@ -1676,7 +1676,7 @@ Image* AccelerateRadialBlurImage(const Image *image, const ChannelType channel,
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, channel, exception);
+  status = checkAccelerateCondition(image, channel);
   if (status == MagickFalse)
     return NULL;
 
@@ -2383,7 +2383,7 @@ Image* AccelerateUnsharpMaskImage(const Image *image, const ChannelType channel,
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, channel, exception);
+  status = checkAccelerateCondition(image, channel);
   if (status == MagickFalse)
     return NULL;
 
@@ -2452,7 +2452,9 @@ static MagickBooleanType resizeHorizontalFilter(cl_mem inputImage
   /* get the local memory size supported by the device */
   deviceLocalMemorySize = GetOpenCLDeviceLocalMemorySize(clEnv);
 
+DisableMSCWarning(4127)
   while(1)
+RestoreMSCWarning
   {
     /* calculate the local memory size needed per workgroup */
     cacheRangeStart = (int) (((0 + 0.5)/xFactor+MagickEpsilon)-support+0.5);
@@ -2632,7 +2634,9 @@ static MagickBooleanType resizeVerticalFilter(cl_mem inputImage
   /* get the local memory size supported by the device */
   deviceLocalMemorySize = GetOpenCLDeviceLocalMemorySize(clEnv);
 
+DisableMSCWarning(4127)
   while(1)
+RestoreMSCWarning
   {
     /* calculate the local memory size needed per workgroup */
     cacheRangeStart = (int) (((0 + 0.5)/yFactor+MagickEpsilon)-support+0.5);
@@ -3047,7 +3051,7 @@ Image* AccelerateResizeImage(const Image* image, const size_t resizedColumns, co
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, AllChannels, exception);
+  status = checkAccelerateCondition(image, AllChannels);
   if (status == MagickFalse)
     return NULL;
 
@@ -3207,7 +3211,7 @@ MagickBooleanType AccelerateContrastImage(Image* image, const MagickBooleanType
   if (status == MagickFalse)
     return MagickFalse;
 
-  status = checkAccelerateCondition(image, AllChannels, exception);
+  status = checkAccelerateCondition(image, AllChannels);
   if (status == MagickFalse)
     return MagickFalse;
 
@@ -3415,7 +3419,7 @@ MagickBooleanType AccelerateModulateImage(Image* image, double percent_brightnes
   if (status == MagickFalse)
     return MagickFalse;
 
-  status = checkAccelerateCondition(image, AllChannels, exception);
+  status = checkAccelerateCondition(image, AllChannels);
   if (status == MagickFalse)
     return MagickFalse;
 
@@ -3921,7 +3925,7 @@ MagickBooleanType AccelerateEqualizeImage(Image* image, const ChannelType channe
   if (status == MagickFalse)
     return MagickFalse;
 
-  status = checkAccelerateCondition(image, channel, exception);
+  status = checkAccelerateCondition(image, channel);
   if (status == MagickFalse)
     return MagickFalse;
 
@@ -4284,7 +4288,7 @@ Image* AccelerateDespeckleImage(const Image* image, ExceptionInfo* exception)
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, AllChannels, exception);
+  status = checkAccelerateCondition(image, AllChannels);
   if (status == MagickFalse)
     return NULL;
 
@@ -4809,11 +4813,13 @@ Image* AccelerateAddNoiseImage(const Image *image, const ChannelType channel,
   if (status == MagickFalse)
     return NULL;
 
-  status = checkAccelerateCondition(image, channel, exception);
+  status = checkAccelerateCondition(image, channel);
   if (status == MagickFalse)
     return NULL;
 
+DisableMSCWarning(4127)
   if (sizeof(unsigned long) == 4)
+RestoreMSCWarning
     filteredImage = ComputeAddNoiseImageOptRandomNum(image,channel,noise_type,exception);
   else
     filteredImage = ComputeAddNoiseImage(image,channel,noise_type,exception);
index 77a9787cc19c4a7591d546f18acc02d9096fd512..5892572782a12c5a55183c1f9bfd3cf44604a68e 100644 (file)
@@ -384,7 +384,11 @@ MagickExport
   MagickBooleanType GetMagickOpenCLEnvParam(MagickCLEnv clEnv, MagickOpenCLEnvParam param
                                           , size_t dataSize, void* data, ExceptionInfo* exception)
 {
-  MagickBooleanType status;
+  MagickBooleanType
+   status;
+
+  magick_unreferenced(exception);
+
   status = MagickFalse;
 
   if (clEnv == NULL
@@ -542,7 +546,7 @@ cleanup:
   return saveSuccessful;
 }
 
-static MagickBooleanType loadBinaryCLProgram(MagickCLEnv clEnv, MagickOpenCLProgram prog, unsigned int signature, ExceptionInfo* exception)
+static MagickBooleanType loadBinaryCLProgram(MagickCLEnv clEnv, MagickOpenCLProgram prog, unsigned int signature)
 {
   MagickBooleanType loadSuccessful;
   unsigned char* binaryProgram;
@@ -701,7 +705,7 @@ static MagickBooleanType CompileOpenCLKernels(MagickCLEnv clEnv, ExceptionInfo*
 
     /* try to load the binary first */
     if (!getenv("MAGICK_OCL_REC"))
-      loadSuccessful = loadBinaryCLProgram(clEnv, (MagickOpenCLProgram)i, programSignature, exception);
+      loadSuccessful = loadBinaryCLProgram(clEnv, (MagickOpenCLProgram)i, programSignature);
 
     if (loadSuccessful == MagickFalse)
     {
@@ -1425,11 +1429,11 @@ cleanup:
   return status;
 }
 
-/* Pointer to a function that calculates the score of a device (ex: device->score) 
- update the data size of score. The encoding and the format of the score data 
- is implementation defined. The function should return DS_SUCCESS if there's no error to be reported.
+/*\r
+  Pointer to a function that updates the score of a device (ex: device->score)\r
+  The function should return DS_SUCCESS if there's no error to be reported.\r
  */
-typedef ds_status (*ds_perf_evaluator)(ds_device* device, void* data);
+typedef ds_status (*ds_perf_evaluator)(ds_device* device);
 
 typedef enum {
   DS_EVALUATE_ALL
@@ -1437,7 +1441,7 @@ typedef enum {
 } ds_evaluation_type;
 
 static ds_status profileDevices(ds_profile* profile, const ds_evaluation_type type
-                         ,ds_perf_evaluator evaluator, void* evaluatorData, unsigned int* numUpdates) {
+                         ,ds_perf_evaluator evaluator, unsigned int* numUpdates) {
   ds_status status = DS_SUCCESS;
   unsigned int i;
   unsigned int updates = 0;
@@ -1458,7 +1462,7 @@ static ds_status profileDevices(ds_profile* profile, const ds_evaluation_type ty
         break;
       /*  else fall through */
     case DS_EVALUATE_ALL:
-      evaluatorStatus = evaluator(profile->devices+i, evaluatorData);
+      evaluatorStatus = evaluator(profile->devices+i);
       if (evaluatorStatus != DS_SUCCESS) {
         status = evaluatorStatus;
         return status;
@@ -1686,7 +1690,7 @@ static ds_status readProfileFromFile(ds_profile* profile, ds_score_deserializer
     }
 
     versionStringLength = strlen(profile->version);
-    if (versionStringLength!=(dataEnd-dataStart)   
+    if (versionStringLength!=(size_t)(dataEnd-dataStart)   
         || strncmp(profile->version, dataStart, versionStringLength)!=(int)0) {
       /* version mismatch */
       status = DS_PROFILE_FILE_ERROR;
@@ -1695,7 +1699,9 @@ static ds_status readProfileFromFile(ds_profile* profile, ds_score_deserializer
     currentPosition = dataEnd+strlen(DS_TAG_VERSION_END);
 
     /* parse the device information */
+DisableMSCWarning(4127)
     while (1) {
+RestoreMSCWarning
       unsigned int i;
 
       const char* deviceTypeStart;
@@ -1814,8 +1820,8 @@ static ds_status readProfileFromFile(ds_profile* profile, ds_score_deserializer
             
             actualDeviceNameLength = strlen(profile->devices[i].oclDeviceName);
             driverVersionLength = strlen(profile->devices[i].oclDriverVersion);
-            if (actualDeviceNameLength == (deviceNameEnd - deviceNameStart)
-               && driverVersionLength == (deviceDriverEnd - deviceDriverStart)
+            if (actualDeviceNameLength == (size_t)(deviceNameEnd - deviceNameStart)
+               && driverVersionLength == (size_t)(deviceDriverEnd - deviceDriverStart)
                && maxComputeUnits == profile->devices[i].oclMaxComputeUnits
                && maxClockFrequency == profile->devices[i].oclMaxClockFrequency
                && strncmp(profile->devices[i].oclDeviceName, deviceNameStart, actualDeviceNameLength)==(int)0
@@ -1935,7 +1941,7 @@ double readAccelerateTimer(AccelerateTimer* timer) { return (double)timer->_cloc
 
 typedef double AccelerateScoreType;
 
-static ds_status AcceleratePerfEvaluator(ds_device* device, void* data) {
+static ds_status AcceleratePerfEvaluator(ds_device* device) {
 
   ds_status status = DS_SUCCESS;
   MagickCLEnv clEnv = NULL;
@@ -2099,7 +2105,7 @@ static MagickBooleanType autoSelectDevice(MagickCLEnv clEnv, ExceptionInfo* exce
          ,DirectorySeparator,IMAGEMAGICK_PROFILE_FILE);
 
   readProfileFromFile(profile, AccelerateScoreDeserializer, path);
-  status = profileDevices(profile, DS_EVALUATE_NEW_ONLY, AcceleratePerfEvaluator, NULL, &numDeviceProfiled);
+  status = profileDevices(profile, DS_EVALUATE_NEW_ONLY, AcceleratePerfEvaluator, &numDeviceProfiled);
   if (status!=DS_SUCCESS) {
     (void) ThrowMagickException(exception, GetMagickModule(), ModuleFatalError, "Error when initializing the profile", "'%s'", ".");
     goto cleanup;