ext/RMagick/rmutil.c in rmagick-3.1.0 vs ext/RMagick/rmutil.c in rmagick-3.2.0
- old
+ new
@@ -357,14 +357,11 @@
* @return arg
*/
static VALUE
arg_is_number(VALUE arg)
{
- double d;
- d = NUM2DBL(arg);
- d = d; // satisfy icc
- return arg;
+ return DBL2NUM(NUM2DBL(arg));
}
/**
* Called when `rb_str_to_str' raises an exception.
@@ -470,13 +467,12 @@
*
* @param ignored a Ruby object (unused)
* @return 0
*/
static VALUE
-rescue_not_dbl(VALUE ignored)
+rescue_not_dbl(VALUE ignored ATTRIBUTE_UNUSED)
{
- ignored = ignored; // defeat gcc message
return INT2FIX(0);
}
/**
@@ -1488,11 +1484,11 @@
* @param client_data pointer to the progress method to call
* @return true if calling client_data returns a non-nil value, otherwise false
*/
MagickBooleanType
rm_progress_monitor(
- const char *tag,
+ const char *tag ATTRIBUTE_UNUSED,
const MagickOffsetType of,
const MagickSizeType sp,
void *client_data)
{
VALUE rval;
@@ -1507,12 +1503,10 @@
// If there is not enough stack or the using stack size shows an abnormal value in Ruby,
// skip the callback and continue ImageMagick process.
return MagickTrue;
}
- tag = tag; // defeat gcc message
-
#if defined(HAVE_LONG_LONG) // defined in Ruby's defines.h
offset = rb_ll2inum(of);
span = rb_ull2inum(sp);
#else
offset = rb_int2big((long)of);
@@ -1623,14 +1617,10 @@
format_exception(const ExceptionType severity, const char *reason, const char *description, char *msg)
{
int len;
memset(msg, 0, sizeof(ERROR_MSG_SIZE));
-#if defined(HAVE_SNPRINTF)
len = snprintf(msg, ERROR_MSG_SIZE, "%s%s%s",
-#else
- len = sprintf(msg, "%.500s%s%.500s",
-#endif
GetLocaleExceptionMessage(severity, reason),
description ? ": " : "",
description ? GetLocaleExceptionMessage(severity, description) : "");
msg[len] = '\0';