- Solves Distributed Objects that were deadlocking on UNIX due to Thread ID comparison
isTypedef = true;
else if(spec.specifier == VOID) specType.kind = voidType;
else if(spec.specifier == CHAR) specType.kind = charType;
- else if(spec.specifier == INT) { if(specType.kind != shortType && specType.kind != longType) specType.kind = intType; }
+ else if(spec.specifier == INT) { if(specType.kind != shortType && specType.kind != longType && !isLong) specType.kind = intType; }
else if(spec.specifier == UINT) { if(specType.kind != shortType && specType.kind != longType) specType.kind = intType; specType.isSigned = false; }
else if(spec.specifier == INT64) specType.kind = int64Type;
else if(spec.specifier == VALIST)
else if(spec.specifier == SHORT) specType.kind = shortType;
else if(spec.specifier == LONG)
{
- if(isLong)
+ if(isLong || (targetBits == 64 && targetPlatform != win32))
specType.kind = int64Type;
else
specType.kind = intType;
{
char string[20];
GetString(buffer,string,20);
- return strtoul(string, null, 16);
+ return (uint)strtoul(string, null, 16);
}
public char * StripQuotes(char * string, char * output)
static bool UInteger_OnGetDataFromString(Class _class, unsigned int * data, char * string)
{
char * end;
- uint result = strtoul(string, &end, 0);
+ uint result = (uint)strtoul(string, &end, 0);
if(end > string)
{
*data = result;
}
else if(!strcmp(curParam.dataTypeString, "uint"))
{
- argument.expression.ui = strtoul(value, null, 0);
+ argument.expression.ui = (uint)strtoul(value, null, 0);
}
else if(!strcmp(curParam.dataTypeString, "char"))
{
}
else // if(!strcmp(curParam.dataTypeString, "int"))
{
- argument.expression.i = strtol(value, null, 0);
+ argument.expression.i = (int)strtol(value, null, 0);
}
break;
}
png_set_tRNS_to_alpha(png_ptr);
numPasses = png_set_interlace_handling(png_ptr);
- if((result = bitmap.Allocate(null, width, height, 0, pixelFormatRGBA, false)))
+ if((result = bitmap.Allocate(null, (uint)width, (uint)height, 0, pixelFormatRGBA, false)))
{
int pass;
return HB_Err_Invalid_Argument;
error = FT_Load_Sfnt_Table(face, tableTag, 0, buffer, &ftlen);
- *length = ftlen;
+ *length = (uint)ftlen;
return (HB_Error)error;
}
if (point > *nPoints)
return (HB_Error)HB_Err_Invalid_SubTable;
- *xpos = face->glyph->outline.points[point].x;
- *ypos = face->glyph->outline.points[point].y;
+ *xpos = (int)face->glyph->outline.points[point].x;
+ *ypos = (int)face->glyph->outline.points[point].y;
return HB_Err_Ok;
}
hb_getPointInOutline, hb_getGlyphMetrics, hb_getFontMetric
};
-static uint FT_stream_load(FT_Stream stream, uint offset, byte * buffer, uint count)
+static uint FT_stream_load(FT_Stream stream, long offset, byte * buffer, long count)
{
File f = stream->descriptor.pointer;
- f.Seek(offset, start);
- return count ? f.Read(buffer, 1, count) : 0;
+ f.Seek((int)offset, start);
+ return count ? f.Read(buffer, 1, (uint)count) : 0;
}
static void FT_stream_close(FT_Stream stream)
fontEntry.hbFont.x_ppem = fontEntry.face->size->metrics.x_ppem;
fontEntry.hbFont.y_ppem = fontEntry.face->size->metrics.y_ppem;
- fontEntry.hbFont.x_scale = fontEntry.face->size->metrics.x_scale;
- fontEntry.hbFont.y_scale = fontEntry.face->size->metrics.y_scale;
+ fontEntry.hbFont.x_scale = (int)fontEntry.face->size->metrics.x_scale;
+ fontEntry.hbFont.y_scale = (int)fontEntry.face->size->metrics.y_scale;
}
}
//glyph->top = (int)(ascender - slot->bitmap_top); // + ((faces[c]->size->metrics.height >> 6) - (faces[0]->size->metrics.height >> 6)) + (font.height - (faces[c]->size->metrics.height >> 6));
//glyph->top = (int)(ascender - slot->bitmap_top);// + (font.height - maxHeight);
- glyph->top = (int)(ascender - slot->bitmap_top) + (font.height - (faces[c]->size->metrics.height >> 6)) / 2;
+ glyph->top = (int)(ascender - slot->bitmap_top) + (int)(font.height - (faces[c]->size->metrics.height >> 6)) / 2;
// printf("[char: %d] mode: %d, width: %d, height: %d, pitch: %d\n", key + c, slot->bitmap.pixel_mode, slot->bitmap.width, slot->bitmap.rows, slot->bitmap.pitch);
xMax = x + slot->bitmap.width;
glyph->w = slot->bitmap.width;
glyph->h = slot->bitmap.rows;
glyph->glyphNo = glyphNo;
- glyph->bx = faces[c]->glyph->metrics.horiBearingX;
- glyph->by = faces[c]->glyph->metrics.horiBearingY;
+ glyph->bx = (int)faces[c]->glyph->metrics.horiBearingX;
+ glyph->by = (int)faces[c]->glyph->metrics.horiBearingY;
glyph->scale = scales[c];
- glyph->ax = slot->advance.x;
- glyph->ay = slot->advance.y + (64 - slot->advance.y % 64);
+ glyph->ax = (int)slot->advance.x;
+ glyph->ay = (int)(slot->advance.y + (64 - slot->advance.y % 64));
}
#if 0
{
}
FT_Set_Transform(fontEntry.face, &matrix, &pen );
FaceSetCharSize(fontEntry.face, size);
- font.height = ((fontEntry.face->size->metrics.height) >> 6); //* y_scale;
+ font.height = (int)((fontEntry.face->size->metrics.height) >> 6); //* y_scale;
// printf("Font height is %d\n", font.height);
font.fakeItalic = fakeItalic;
font.size = size;
bool NotifyModified(EditBox control)
{
ColorRGB rgb;
- int value = strtoul(control.contents, null, 16);
+ uint value = (uint)strtoul(control.contents, null, 16);
if(strlen(control.contents) <= 6)
value |= 0xFF000000;
- argb = (unsigned int)value;
+ argb = value;
rgb = argb;
cmyk = rgb;
hsv = rgb;
if(data)
{
int desktops = 0;
- desktops = *(long *)data;
+ desktops = (int)*(long *)data;
//printf("_NET_NUMBER_OF_DESKTOPS is %d\n", desktops);
if(data)
{
- current = *(long *)data;
+ current = (int)*(long *)data;
XFree(data);
data = null;
{
workareas = (long *)data;
- x = workareas[current * 4];
- y = workareas[current * 4 + 1];
- w = workareas[current * 4 + 2];
- h = workareas[current * 4 + 3];
+ x = (int)workareas[current * 4];
+ y = (int)workareas[current * 4 + 1];
+ w = (int)workareas[current * 4 + 2];
+ h = (int)workareas[current * 4 + 3];
//printf("_NET_WORKAREA is x = %d, y = %d, w = %d, h = %d\n", x, y, w, h);
XFree(data);
*/
if(!buf)
- buf = malloc(bufsize);
+ buf = malloc((uint)bufsize);
if(windowData && windowData.ic)
{
- buflength = XmbLookupString(windowData.ic, event, buf, bufsize, &keysym, &status);
+ buflength = XmbLookupString(windowData.ic, event, buf, (int)bufsize, &keysym, &status);
if (status == XBufferOverflow)
{
- buf = realloc(buf, (bufsize = buflength));
- buflength = XmbLookupString(windowData.ic, event, buf, bufsize, &keysym, &status);
+ buf = realloc(buf, (uint)(bufsize = buflength));
+ buflength = XmbLookupString(windowData.ic, event, buf, (int)bufsize, &keysym, &status);
}
if(status != XLookupKeySym && status != XLookupBoth && release == 1)
keysym = XLookupKeysym(event, 0);
{
XVisualInfo vinfo;
XVisualInfo *vinfo_ret;
- long numitems;
+ int numitems = 0;
vinfo.visualid = XVisualIDFromVisual(xSystemVisual);
vinfo_ret = XGetVisualInfo(xGlobalDisplay, VisualIDMask, &vinfo, &numitems);
event->x_root, event->y_root, &keyFlags, false, false);
delete window;
//*if(xGlobalDisplay) XLockDisplay(xGlobalDisplay);
- lastTime = event->time;
+ lastTime = (uint)event->time;
}
break;
}
//if(event->send_event)
{
X11Window rootChild;
- long rootX, rootY;
+ int rootX, rootY;
XTranslateCoordinates(xGlobalDisplay, event->window,
RootWindow(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 0, 0,
&rootX, &rootY, &rootChild);
bool laterFocus;
activeWindow = (X11Window)window.windowHandle;
- timeStamp = event->data.l[1];
+ timeStamp = (int)event->data.l[1];
windowData = window.windowData;
laterFocus = windowData.laterFocus;
bool hadFrameExtents = windowData.gotFrameExtents;
windowData.decor =
{
- left = extents[0], right = extents[1],
- top = extents[2], bottom = extents[3]
+ left = (int)extents[0], right = (int)extents[1],
+ top = (int)extents[2], bottom = (int)extents[3]
};
windowData.gotFrameExtents = true;
{
fd_set ws, es;
if(s != -1 && ((type == tcp && (count = SendData(buffer, size, 0))) ||
- (type == udp && (count = sendto(s, buffer, size,0, (SOCKADDR *)&a, sizeof(a))))))
+ (type == udp && (count = (int)sendto(s, buffer, size,0, (SOCKADDR *)&a, sizeof(a))))))
{
#if defined(__WIN32__)
int error = WSAGetLastError();
else
{
int len = sizeof(a);
- count = recvfrom(s, recvBuffer + recvBytes,
+ count = (int)recvfrom(s, recvBuffer + recvBytes,
recvBufferSize - recvBytes, 0, (SOCKADDR *)&a, &len);
strcpy(inetAddress, inet_ntoa(this.a.sin_addr));
inetPort = ntohs((uint16)a.sin_port);
{
unsigned long destLen = entry.size;
uncompress(uncompressed, &destLen, compressed, entry.cSize);
- entry.size = destLen;
+ entry.size = (FileSize)destLen; // TODO: Support 64 bit file sizes
}
delete compressed;
}
{
unsigned long destLen = entry.size;
uncompress(uncompressed, &destLen, compressed, entry.cSize);
- entry.size = destLen;
+ entry.size = (FileSize)destLen;
}
delete compressed;
}
{
unsigned long destLen = entry.size;
uncompress(uncompressed, &destLen, compressed, entry.cSize);
- entry.size = destLen;
+ entry.size = (FileSize)destLen;
}
delete compressed;
}
if(compressed)
{
compress2(compressed, &destLen, uncompressed, entry.size, compression);
- entry.cSize = destLen;
+ entry.cSize = (FileSize)destLen;
}
}
delete uncompressed;
{
unsigned long destLen = entry.size;
uncompress(uncompressed, &destLen, compressed, entry.cSize);
- entry.size = destLen;
+ entry.size = (FileSize)destLen;
}
delete compressed;
}
virtual uint Tell(void)
{
- return input ? ftell(input) : ftell(output);
+ return (uint)(input ? ftell(input) : ftell(output));
}
virtual int Read(void * buffer, uint size, uint count)
{
char string[32];
GetString(string, sizeof(string));
- return strtoul(string, null, 16);
+ return (uint)strtoul(string, null, 16);
}
float GetFloat(void)
if(!stat(file.path, &s))
{
file.stats.attribs = (s.st_mode&S_IFDIR) ? FileAttribs { isDirectory = true } : FileAttribs { isFile = true };
- file.stats.size = s.st_size;
+ file.stats.size = (FileSize)s.st_size;
file.stats.accessed = s.st_atime;
file.stats.modified = s.st_mtime;
file.stats.created = s.st_ctime;
{
stats.attribs = FileAttribs { };
stats.attribs = (s.st_mode&S_IFDIR) ? FileAttribs { isDirectory = true } : FileAttribs { isFile = true };
- stats.size = s.st_size;
+ stats.size = (FileSize)s.st_size;
stats.accessed = s.st_atime;
stats.modified = s.st_mtime;
stats.created = s.st_ctime;
case integer:
{
int * integer = value;
- *integer = strtoul(string, null, 0);
+ *integer = (int)strtol(string, null, 0);
break;
}
}
if(!secbase)
{
- secbase = tp.tv_sec;
+ secbase = (int)tp.tv_sec;
return tp.tv_usec / 1000000.0;
}
return (tp.tv_sec - secbase) + tp.tv_usec / 1000000.0;
if(line[0] && line[0] != '#')
{
char * endPtr;
- uint start = strtoul(line, &endPtr, 16);
+ uint start = (uint)strtoul(line, &endPtr, 16);
if(endPtr)
{
- uint end = (endPtr && *endPtr == '.') ? strtoul(endPtr + 2, &endPtr, 16) : start;
+ uint end = (endPtr && *endPtr == '.') ? (uint)strtoul(endPtr + 2, &endPtr, 16) : start;
if(endPtr)
{
endPtr = strchr(endPtr, ';');