ext/RMagick/rminfo.c in rmagick-2.3.0 vs ext/RMagick/rminfo.c in rmagick-2.4.0

- old
+ new

@@ -1,6 +1,6 @@ -/* $Id: rminfo.c,v 1.70 2008/01/02 15:52:19 rmagick Exp $ */ +/* $Id: rminfo.c,v 1.71 2008/05/21 22:32:41 rmagick Exp $ */ /*============================================================================\ | Copyright (C) 2008 by Timothy P. Hunter | Name: rminfo.c | Author: Tim Hunter | Purpose: Info class method definitions for RMagick. @@ -233,11 +233,11 @@ VALUE Info_aset(int argc, VALUE *argv, VALUE self) { Info *info; volatile VALUE value; - char *format_p, *key_p, *value_p = ""; + char *format_p, *key_p, *value_p = NULL; long format_l, key_l; char ckey[MaxTextExtent]; unsigned int okay; @@ -526,11 +526,12 @@ */ VALUE Info_define(int argc, VALUE *argv, VALUE self) { Info *info; - char *format, *key, *value = ""; + char *format, *key; + const char *value = ""; long format_l, key_l; char ckey[100]; unsigned int okay; volatile VALUE fmt_arg; @@ -539,11 +540,11 @@ switch (argc) { case 3: /* Allow any argument that supports to_s */ fmt_arg = rb_funcall(argv[2], rm_ID_to_s, 0); - value = StringValuePtr(fmt_arg); + value = (const char *)StringValuePtr(fmt_arg); case 2: key = rm_str2cstr(argv[1], &key_l); format = rm_str2cstr(argv[0], &format_l); break; default: @@ -718,12 +719,12 @@ Purpose: Retrieve a dispose option string and convert it to a DisposeType enumerator */ static struct { - char *string; - char *enum_name; + const char *string; + const char *enum_name; DisposeType enumerator; } Dispose_Option[] = { { "Background", "BackgroundDispose", BackgroundDispose}, { "None", "NoneDispose", NoneDispose}, { "Previous", "PreviousDispose", PreviousDispose}, @@ -772,11 +773,11 @@ VALUE Info_dispose_eq(VALUE self, VALUE disp) { Info *info; DisposeType dispose; - char *option; + const char *option; int x; Data_Get_Struct(self, Info, info); if (NIL_P(disp)) @@ -1004,12 +1005,12 @@ Purpose: Return the value of the gravity option as a GravityType enumerator */ static struct { - char *string; - char *enum_name; + const char *string; + const char *enum_name; GravityType enumerator; } Gravity_Option[] = { { "Undefined", "UndefinedGravity", UndefinedGravity}, { "None", "UndefinedGravity", UndefinedGravity}, { "Center", "CenterGravity", CenterGravity}, @@ -1062,11 +1063,11 @@ VALUE Info_gravity_eq(VALUE self, VALUE grav) { Info *info; GravityType gravity; - char *option; + const char *option; int x; Data_Get_Struct(self, Info, info); if (NIL_P(grav)) @@ -1740,10 +1741,10 @@ Extern: rm_info_new Purpose: provide a Info.new method for internal use Notes: takes no parameters, but runs the parm block if present */ VALUE -rm_info_new() +rm_info_new(void) { volatile VALUE info_obj; info_obj = Info_alloc(Class_Info); return Info_initialize(info_obj);