hello every, my first patch, above c++ compiler warning about char * and const string

2 messages Options
Embed this post
Permalink
Anson-11

hello every, my first patch, above c++ compiler warning about char * and const string

Reply Threaded More More options
Print post
Permalink
Index: modules/FrontEnd/scim_x11_ic.cpp
===================================================================
--- modules/FrontEnd/scim_x11_ic.cpp    (revision 102)
+++ modules/FrontEnd/scim_x11_ic.cpp    (working copy)
@@ -40,7 +40,7 @@
 using namespace scim;
 
 static int
-_is_attr (char *attr, XICAttribute * attr_list)
+_is_attr (const char *attr, XICAttribute * attr_list)
 {
   return !strcmp (attr, attr_list->name);
 }
Index: data/icons/right.xpm
===================================================================
--- data/icons/right.xpm    (revision 102)
+++ data/icons/right.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * right_xpm[] = {
+static const char * right_xpm[] = {
 "16 16 43 1",
 "     c None",
 ".    c #000000",
Index: data/icons/up.xpm
===================================================================
--- data/icons/up.xpm    (revision 102)
+++ data/icons/up.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *up_xpm[] = {
+static const char *up_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "16 16 65 1",
 "  c #000000",
Index: data/icons/pin-down.xpm
===================================================================
--- data/icons/pin-down.xpm    (revision 102)
+++ data/icons/pin-down.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * pin_down_xpm[] = {
+static const char * pin_down_xpm[] = {
 "16 16 4 1",
 "     c None",
 ".    c #000000",
Index: data/icons/half-punct.xpm
===================================================================
--- data/icons/half-punct.xpm    (revision 102)
+++ data/icons/half-punct.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * half_punct_xpm[] = {
+static const char * half_punct_xpm[] = {
 "16 16 2 1",
 "     c None",
 ".    c #1520EF",
Index: data/icons/menu.xpm
===================================================================
--- data/icons/menu.xpm    (revision 102)
+++ data/icons/menu.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *menu_xpm[] = {
+static const char *menu_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "16 16 4 1",
 "  c black",
Index: data/icons/down.xpm
===================================================================
--- data/icons/down.xpm    (revision 102)
+++ data/icons/down.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *down_xpm[] = {
+static const char *down_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "16 16 64 1",
 "  c #000000",
Index: data/icons/half-letter.xpm
===================================================================
--- data/icons/half-letter.xpm    (revision 102)
+++ data/icons/half-letter.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *half_letter_xpm[]={
+static const char *half_letter_xpm[]={
 "16 16 2 1",
 ". c None",
 "# c #0000ff",
Index: data/icons/trademark.xpm
===================================================================
--- data/icons/trademark.xpm    (revision 102)
+++ data/icons/trademark.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * trademark_xpm[] = {
+static const char * trademark_xpm[] = {
 "24 24 5 1",
 "     c None",
 ".    c #3D55FD",
Index: data/icons/help.xpm
===================================================================
--- data/icons/help.xpm    (revision 102)
+++ data/icons/help.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *help_xpm[] = {
+static const char *help_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "16 16 16 1",
 "  c black",
Index: data/icons/full-punct.xpm
===================================================================
--- data/icons/full-punct.xpm    (revision 102)
+++ data/icons/full-punct.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * full_punct_xpm[] = {
+static const char * full_punct_xpm[] = {
 "16 16 2 1",
 "     c None",
 ".    c #1520EF",
Index: data/icons/left.xpm
===================================================================
--- data/icons/left.xpm    (revision 102)
+++ data/icons/left.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * left_xpm[] = {
+static const char * left_xpm[] = {
 "16 16 40 1",
 "     c None",
 ".    c #000000",
Index: data/icons/full-letter.xpm
===================================================================
--- data/icons/full-letter.xpm    (revision 102)
+++ data/icons/full-letter.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *full_letter_xpm[]={
+static const char *full_letter_xpm[]={
 "16 16 2 1",
 ". c None",
 "# c #0000ff",
Index: data/icons/setup.xpm
===================================================================
--- data/icons/setup.xpm    (revision 102)
+++ data/icons/setup.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *setup_xpm[]={
+static const char *setup_xpm[]={
 "16 16 15 1",
 ". c None",
 "# c #000000",
Index: data/icons/pin-up.xpm
===================================================================
--- data/icons/pin-up.xpm    (revision 102)
+++ data/icons/pin-up.xpm    (working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * pin_up_xpm[] = {
+static const char * pin_up_xpm[] = {
 "16 16 4 1",
 "     c None",
 ".    c #000000",


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Scim-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/scim-devel
Ryo Dairiki-2

Re: hello every, my first patch, above c++ compiler warning about char * and const string

Reply Threaded More More options
Print post
Permalink
Hi Anson,

This patch has just been imported into SVN.

Regards,
Ryo Dairiki <[hidden email]>

P.S.

Write your message in the message body, instead of leaving it as title-only.

Anson wrote:

> Index: modules/FrontEnd/scim_x11_ic.cpp
> ===================================================================
> --- modules/FrontEnd/scim_x11_ic.cpp    (revision 102)
> +++ modules/FrontEnd/scim_x11_ic.cpp    (working copy)
> @@ -40,7 +40,7 @@
>  using namespace scim;
>  
>  static int
> -_is_attr (char *attr, XICAttribute * attr_list)
> +_is_attr (const char *attr, XICAttribute * attr_list)
>  {
>    return !strcmp (attr, attr_list->name);
>  }
> Index: data/icons/right.xpm
> ===================================================================
> --- data/icons/right.xpm    (revision 102)
> +++ data/icons/right.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * right_xpm[] = {
> +static const char * right_xpm[] = {
>  "16 16 43 1",
>  "     c None",
>  ".    c #000000",
> Index: data/icons/up.xpm
> ===================================================================
> --- data/icons/up.xpm    (revision 102)
> +++ data/icons/up.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *up_xpm[] = {
> +static const char *up_xpm[] = {
>  /* columns rows colors chars-per-pixel */
>  "16 16 65 1",
>  "  c #000000",
> Index: data/icons/pin-down.xpm
> ===================================================================
> --- data/icons/pin-down.xpm    (revision 102)
> +++ data/icons/pin-down.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * pin_down_xpm[] = {
> +static const char * pin_down_xpm[] = {
>  "16 16 4 1",
>  "     c None",
>  ".    c #000000",
> Index: data/icons/half-punct.xpm
> ===================================================================
> --- data/icons/half-punct.xpm    (revision 102)
> +++ data/icons/half-punct.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * half_punct_xpm[] = {
> +static const char * half_punct_xpm[] = {
>  "16 16 2 1",
>  "     c None",
>  ".    c #1520EF",
> Index: data/icons/menu.xpm
> ===================================================================
> --- data/icons/menu.xpm    (revision 102)
> +++ data/icons/menu.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *menu_xpm[] = {
> +static const char *menu_xpm[] = {
>  /* columns rows colors chars-per-pixel */
>  "16 16 4 1",
>  "  c black",
> Index: data/icons/down.xpm
> ===================================================================
> --- data/icons/down.xpm    (revision 102)
> +++ data/icons/down.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *down_xpm[] = {
> +static const char *down_xpm[] = {
>  /* columns rows colors chars-per-pixel */
>  "16 16 64 1",
>  "  c #000000",
> Index: data/icons/half-letter.xpm
> ===================================================================
> --- data/icons/half-letter.xpm    (revision 102)
> +++ data/icons/half-letter.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *half_letter_xpm[]={
> +static const char *half_letter_xpm[]={
>  "16 16 2 1",
>  ". c None",
>  "# c #0000ff",
> Index: data/icons/trademark.xpm
> ===================================================================
> --- data/icons/trademark.xpm    (revision 102)
> +++ data/icons/trademark.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * trademark_xpm[] = {
> +static const char * trademark_xpm[] = {
>  "24 24 5 1",
>  "     c None",
>  ".    c #3D55FD",
> Index: data/icons/help.xpm
> ===================================================================
> --- data/icons/help.xpm    (revision 102)
> +++ data/icons/help.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *help_xpm[] = {
> +static const char *help_xpm[] = {
>  /* columns rows colors chars-per-pixel */
>  "16 16 16 1",
>  "  c black",
> Index: data/icons/full-punct.xpm
> ===================================================================
> --- data/icons/full-punct.xpm    (revision 102)
> +++ data/icons/full-punct.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * full_punct_xpm[] = {
> +static const char * full_punct_xpm[] = {
>  "16 16 2 1",
>  "     c None",
>  ".    c #1520EF",
> Index: data/icons/left.xpm
> ===================================================================
> --- data/icons/left.xpm    (revision 102)
> +++ data/icons/left.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * left_xpm[] = {
> +static const char * left_xpm[] = {
>  "16 16 40 1",
>  "     c None",
>  ".    c #000000",
> Index: data/icons/full-letter.xpm
> ===================================================================
> --- data/icons/full-letter.xpm    (revision 102)
> +++ data/icons/full-letter.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *full_letter_xpm[]={
> +static const char *full_letter_xpm[]={
>  "16 16 2 1",
>  ". c None",
>  "# c #0000ff",
> Index: data/icons/setup.xpm
> ===================================================================
> --- data/icons/setup.xpm    (revision 102)
> +++ data/icons/setup.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char *setup_xpm[]={
> +static const char *setup_xpm[]={
>  "16 16 15 1",
>  ". c None",
>  "# c #000000",
> Index: data/icons/pin-up.xpm
> ===================================================================
> --- data/icons/pin-up.xpm    (revision 102)
> +++ data/icons/pin-up.xpm    (working copy)
> @@ -1,5 +1,5 @@
>  /* XPM */
> -static char * pin_up_xpm[] = {
> +static const char * pin_up_xpm[] = {
>  "16 16 4 1",
>  "     c None",
>  ".    c #000000",
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Scim-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/scim-devel
>  


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Scim-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/scim-devel