Permalink
Browse files

signed values need to be sizediff_t rather than size_t

  • Loading branch information...
1 parent e108c5e commit 61fee1b5c7ebb93f96f3c4d7b88df0701c577fed @martindemello committed May 11, 2012
Showing with 21 additions and 13 deletions.
  1. +1 −1 wrap/utils/DefReader.d
  2. +5 −6 wrap/utils/GtkDClass.d
  3. +12 −3 wrap/utils/GtkWrapper.d
  4. +3 −3 wrap/utils/HTODConvert.d
View
@@ -115,7 +115,7 @@ public class DefReader
if ( line.length > 0 )
{
- size_t pos = std.string.indexOf(line, ':');
+ sizediff_t pos = std.string.indexOf(line, ':');
if ( pos > 0 )
{
key = std.string.strip(line[0 .. pos]);
View
@@ -911,7 +911,7 @@ public class GtkDClass
{
debug(getSignal) writefln("\tgetSignal %s", lines[i]);
string[] text;
- size_t endPos = std.string.lastIndexOf(lines[i], '"');
+ sizediff_t endPos = std.string.lastIndexOf(lines[i], '"');
if ( endPos > 5 )
{
string signalName = lines[i][5..endPos];
@@ -1313,10 +1313,10 @@ public class GtkDClass
&& std.string.indexOf(lines[defLine],"<<") < 0
)
{
- size_t pos = std.string.indexOf(lines[defLine], "(");
+ sizediff_t pos = std.string.indexOf(lines[defLine], "(");
if ( pos > 0 )
{
- size_t posf = std.string.indexOf(lines[defLine], ")");
+ sizediff_t posf = std.string.indexOf(lines[defLine], ")");
if ( posf>pos )
{
gTypes ~= lines[0][7..lines[0].length]
@@ -1341,7 +1341,7 @@ public class GtkDClass
string stockID;
string stockValue;
- size_t pos = std.string.indexOf(line[12..line.length],' ')+12;
+ sizediff_t pos = std.string.indexOf(line[12..line.length],' ')+12;
debug(stockItems)writefln("pos=%s", pos);
if ( pos > 12 )
{
@@ -1535,7 +1535,6 @@ public class GtkDClass
if ( pos<lines.length && lines[pos][0] != '}' )
{
string enumPrefix = getEnumPrefix(enumName, std.string.strip(lines[pos]));
- size_t prefixLength = enumPrefix.length;
while ( pos<lines.length && lines[pos][0] != '}' )
{
debug(enums)writefln("\tenum line %s", lines[pos]);
@@ -2730,7 +2729,7 @@ public class GtkDClass
debug(enumToGtkD)writefln("enumLine (%s) BEFORE %s", enumType, gToken);
string converted = stringToGtkD(gToken, convParms, wrapper.getAliases());
- size_t pos = std.string.indexOf(converted, '=');
+ sizediff_t pos = std.string.indexOf(converted, '=');
debug(enumToGtkD)writefln("\t pos = %s", pos);
if ( pos > 0 )
{
View
@@ -920,7 +920,10 @@ public class GtkWrapper : WrapperIF
foreach ( string declaration; declarations )
{
string dec = std.string.strip(declaration);
- size_t pos = std.string.lastIndexOf(dec,')');
+ sizediff_t pos = std.string.lastIndexOf(dec,')');
+
+ if (dec.length == 0)
+ continue;
if ( GtkDClass.startsWith(dec, "//") )
externalText ~= "\n\t"~ dec ~"\n\n";
@@ -954,10 +957,13 @@ public class GtkWrapper : WrapperIF
{
string dec = std.string.strip(declaration);
+ if (dec.length == 0)
+ continue;
+
if ( loaderTableName == "glib" || loaderTableName == "pango" )
dec = replace(dec, "FILE*", "void*"); //Phobos workaround.
- size_t pos = std.string.lastIndexOf(dec,')') + 1;
+ sizediff_t pos = std.string.lastIndexOf(dec,')') + 1;
externalText ~= '\t';
if ( dec.length > 0 && dec[0]=='#' )
@@ -977,7 +983,10 @@ public class GtkWrapper : WrapperIF
foreach ( string declaration; declarations )
{
string dec = std.string.strip(declaration);
- size_t pos = std.string.lastIndexOf(dec,')');
+ sizediff_t pos = std.string.lastIndexOf(dec,')');
+
+ if (dec.length == 0)
+ continue;
if ( GtkDClass.startsWith(dec, "//") )
externalText ~= '\n'~ dec ~"\n\n";
View
@@ -88,7 +88,7 @@ public class Ranges
{
bool incl = true;
Range* range;
- size_t i=ranges.length;
+ size_t i = ranges.length;
while ( i > 0 )
{
range = ranges[--i];
@@ -422,11 +422,11 @@ public class HTODConvert
}
else
{
- size_t end = std.string.indexOf(line,'(');
+ sizediff_t end = std.string.indexOf(line,'(');
if ( end > 0 )
{
- size_t start = end;
+ sizediff_t start = end;
while ( start > 0 && line[start] > ' ' )
{
--start;

0 comments on commit 61fee1b

Please sign in to comment.