Removing some warnings.

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Spoke
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06
Location: Spain
Contact:

Removing some warnings.

Postby Spoke » Thu Jun 03, 2004 01:29

Hi!

Here are the patch files

Code: Select all

Index: include/CEGUIImageset.h
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/include/CEGUIImageset.h,v
retrieving revision 1.3
diff -u -r1.3 CEGUIImageset.h
--- include/CEGUIImageset.h   1 Jun 2004 11:04:01 -0000   1.3
+++ include/CEGUIImageset.h   2 Jun 2004 08:40:54 -0000
@@ -124,7 +124,7 @@
    \return
       uint value equal to the number of Image objects defined for the Imageset
    */
-   uint      getImageCount(void) const               {return d_images.size();}
+   uint      getImageCount(void) const               {return (uint)d_images.size();}
 
 
    /*!


Code: Select all

Index: include/CEGUIString.h
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/include/CEGUIString.h,v
retrieving revision 1.3
diff -u -r1.3 CEGUIString.h
--- include/CEGUIString.h   30 May 2004 16:02:23 -0000   1.3
+++ include/CEGUIString.h   2 Jun 2004 08:40:54 -0000
@@ -780,7 +780,7 @@
          len = d_cplength - idx;
 
       if ((str_len == npos) || (str_idx + str_len > std_str.size()))
-         str_len = std_str.size() - str_idx;
+         str_len = (size_type)std_str.size() - str_idx;
 
       int val = (len == 0) ? 0 : utf32_comp_char(&ptr()[idx], &std_str.c_str()[str_idx], (len < str_len) ? len : str_len);
 
@@ -1181,7 +1181,7 @@
          throw std::out_of_range("Index was out of range for std::string object");
 
       if (str_num == npos)
-         str_num = std_str.size() - str_idx;
+         str_num = (size_type)std_str.size() - str_idx;
 
       grow(str_num);
       setlen(str_num);
@@ -1459,7 +1459,7 @@
          throw std::out_of_range("Index is out of range for std::string");
 
       if (str_num == npos)
-         str_num = std_str.size() - str_idx;
+         str_num = (size_type)std_str.size() - str_idx;
 
       size_type newsze = d_cplength + str_num;
 
@@ -1768,7 +1768,7 @@
          throw std::out_of_range("Index is out of range for std::string");
 
       if (str_num == npos)
-         str_num = std_str.size() - str_idx;
+         str_num = (size_type)std_str.size() - str_idx;
 
       size_type newsz = d_cplength + str_num;
       grow(newsz);
@@ -2321,7 +2321,7 @@
          throw std::out_of_range("Index is out of range for std::string");
 
       if (((str_idx + str_num) > std_str.size()) || (str_num == npos))
-         str_num = std_str.size() - str_idx;
+         str_num = (size_type)std_str.size() - str_idx;
 
       if (((len + idx) > d_cplength) || (len == npos))
          len = d_cplength - idx;
@@ -2813,7 +2813,7 @@
       // loop while search string could fit in to search area
       while (d_cplength - idx >= sze)
       {
-         if (0 == compare(idx, sze, std_str))
+         if (0 == compare(idx, (size_type)sze, std_str))
             return idx;
 
          ++idx;
@@ -2860,7 +2860,7 @@
 
       do
       {
-         if (0 == compare(idx, sze, std_str))
+         if (0 == compare(idx, (size_type)sze, std_str))
             return idx;
 
       } while (idx-- != 0);
@@ -4311,7 +4311,7 @@
    // return index of first occurrence of 'code_point' in std::string 'str', or npos if none
    size_type find_codepoint(const std::string& str, utf32 code_point) const
    {
-      size_type idx = 0, sze = str.size();
+      size_type idx = 0, sze = (size_type)str.size();
 
       while (idx != sze)
       {


Code: Select all

Index: include/CEGUIWindow.h
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/include/CEGUIWindow.h,v
retrieving revision 1.11
diff -u -r1.11 CEGUIWindow.h
--- include/CEGUIWindow.h   30 May 2004 16:02:23 -0000   1.11
+++ include/CEGUIWindow.h   2 Jun 2004 08:11:51 -0000
@@ -244,7 +244,7 @@
    \return
       uint value equal to the number of Window objects directly attached to this Window as children.
    */
-   uint   getChildCount(void) const      {return d_children.size();}
+   uint   getChildCount(void) const      {return (uint)d_children.size();}
 
 
    /*!


I also notice that setFrameEnabled, setTitleBarEnabled, setSizingEnabled, setRollupEnabled, setCloseButtonEnabled, and setEnabled calls have no efect over the called, since the disabled widget, still react to the events.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Removing some warnings.

Postby CrazyEddie » Thu Jun 03, 2004 08:18

Aha, the dreaded string class :lol:

Thanks for the patches :) I'll apply them later on today. Out of interest, which compiler and/or warning settings did you use, as I never get any warnings in there on VC++ 7.1 warning level 3.

With reference to the frame window bugs, I was aware the button was not affected by the setting change, but did not know that everything else was also affected :oops: I'll get this sorted out today as well :)

User avatar
Spoke
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06
Location: Spain
Contact:

Removing some warnings.

Postby Spoke » Thu Jun 03, 2004 16:12

We didn´t get warnins when building the library, but when building our project.

We are using VC 7.1 and default warning settings.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Removing some warnings.

Postby CrazyEddie » Thu Jun 03, 2004 17:18

Oh, okay :) Patched files are now in CVS anyway.

User avatar
Spoke
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06
Location: Spain
Contact:

Removing some warnings.

Postby Spoke » Thu Jun 03, 2004 18:50

I see them, thanks man. :wink:


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests