harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r585231 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared: TypeDefinition.cpp TypeDefinition.h
Date Tue, 16 Oct 2007 19:45:42 GMT
Author: hindessm
Date: Tue Oct 16 12:45:40 2007
New Revision: 585231

URL: http://svn.apache.org/viewvc?rev=585231&view=rev
Log:
Avoid gcc 4.2 compiler warnings by making these functions used const pointers.
The warnings occur because calls to the compare functions are given
constant strings as arguments in a number of cases and gcc 4.2 now
complains (correctly) if these are cast to non-const pointers.
Add a carriage return to end of file to avoid another trivial gcc
warning.

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
    harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp?rev=585231&r1=585230&r2=585231&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.cpp
Tue Oct 16 12:45:40 2007
@@ -18,13 +18,13 @@
 
 #include "TypeDefinition.h"
 
-fint fwcslen(fwchar_t* str)
+fint fwcslen(const fwchar_t* str)
 {
     if (!str)
         return 0;
         
 	fint counter=0;
-	fwchar_t* tmpstr = str;
+	const fwchar_t* tmpstr = str;
 	while(*tmpstr != 0)
 	{
 		tmpstr++;
@@ -33,13 +33,13 @@
 	return counter;
 }
 
-fint fwcscmp(fwchar_t* str1, fchar* str2)
+fint fwcscmp(const fwchar_t* str1, const fchar* str2)
 {
     if (str1 == 0 || str2 == 0)
         return (fint)(str1 - (fwchar_t*)str2);
         
-	fwchar_t* tmpstr1 = str1; 
-	fchar* tmpstr2 = str2;
+        const fwchar_t* tmpstr1 = str1; 
+	const fchar* tmpstr2 = str2;
 	while(*tmpstr1 != 0 || *tmpstr2 !=0)
 	{
         if (*tmpstr1 != (fwchar_t)(*tmpstr2))
@@ -52,13 +52,13 @@
 	return 0;
 }
 
-fint fwcscmp(fwchar_t* str1, fwchar_t* str2)
+fint fwcscmp(const fwchar_t* str1, const fwchar_t* str2)
 {
     if (str1 == 0 || str2 == 0)
         return (fint)(str1 - str2);
         
-	fwchar_t* tmpstr1 = str1; 
-	fwchar_t* tmpstr2 = str2;
+	const fwchar_t* tmpstr1 = str1; 
+	const fwchar_t* tmpstr2 = str2;
 	while(*tmpstr1 != 0 || *tmpstr2 !=0)
 	{
         if (*tmpstr1 != *tmpstr2)
@@ -69,4 +69,4 @@
 	}
 
 	return 0;
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h?rev=585231&r1=585230&r2=585231&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/shared/TypeDefinition.h
Tue Oct 16 12:45:40 2007
@@ -29,8 +29,8 @@
 typedef short fshort;
 typedef unsigned short fwchar_t;
 
-fint fwcslen(fwchar_t* str);
-fint fwcscmp(fwchar_t* str1, fchar* str2);
-fint fwcscmp(fwchar_t* str1, fwchar_t* str2);
+fint fwcslen(const fwchar_t* str);
+fint fwcscmp(const fwchar_t* str1, const fchar* str2);
+fint fwcscmp(const fwchar_t* str1, const fwchar_t* str2);
 
 #endif



Mime
View raw message