char buf[1024];
sprintf (buf, "%f %f %f", v[0], v[1], v[2]);
- ret = xmlNewNode (NULL, "point");
- xmlNodeSetContent (ret, buf);
+ ret = xmlNewNode (NULL, (xmlChar*)"point");
+ xmlNodeSetContent (ret, (xmlChar*)buf);
return ret;
}
// l_net library defines an upper limit of MAX_NETMESSAGE
// there are some size check errors, so we use MAX_NETMESSAGE-10 to be safe
// if the size of the buffer exceeds MAX_NETMESSAGE-10 we'll send in several network messages
- while (pos < xml_buf->use)
+ while (pos < (int)xml_buf->use)
{
// what size are we gonna send now?
(xml_buf->use - pos < MAX_NETMESSAGE - 10) ? (size = xml_buf->use - pos) : (size = MAX_NETMESSAGE - 10);
// now build a proper "select" XML node
sprintf (buf, "Entity %i, Brush %i: %s", entitynum, brushnum, msg);
- node = xmlNewNode (NULL, "select");
- xmlNodeSetContent (node, buf);
+ node = xmlNewNode (NULL, (xmlChar*)"select");
+ xmlNodeSetContent (node, (xmlChar*)buf);
level[0] = (int)'0' + (bError ? SYS_ERR : SYS_WRN) ;
level[1] = 0;
- xmlSetProp (node, "level", (char *)&level);
+ xmlSetProp (node, (xmlChar*)"level", (xmlChar *)&level);
// a 'select' information
sprintf (buf, "%i %i", entitynum, brushnum);
- select = xmlNewNode (NULL, "brush");
- xmlNodeSetContent (select, buf);
+ select = xmlNewNode (NULL, (xmlChar*)"brush");
+ xmlNodeSetContent (select, (xmlChar*)buf);
xmlAddChild (node, select);
xml_SendNode (node);
char buf[1024];
char level[2];
- node = xmlNewNode (NULL, "pointmsg");
- xmlNodeSetContent (node, msg);
+ node = xmlNewNode (NULL, (xmlChar*)"pointmsg");
+ xmlNodeSetContent (node, (xmlChar*)msg);
level[0] = (int)'0' + SYS_ERR;
level[1] = 0;
- xmlSetProp (node, "level", (char *)&level);
+ xmlSetProp (node, (xmlChar*)"level", (xmlChar *)&level);
// a 'point' node
sprintf (buf, "%g %g %g", pt[0], pt[1], pt[2]);
- point = xmlNewNode (NULL, "point");
- xmlNodeSetContent (point, buf);
+ point = xmlNewNode (NULL, (xmlChar*)"point");
+ xmlNodeSetContent (point, (xmlChar*)buf);
xmlAddChild (node, point);
xml_SendNode (node);
char level[2];
int i;
- node = xmlNewNode (NULL, "windingmsg");
- xmlNodeSetContent (node, msg);
+ node = xmlNewNode (NULL, (xmlChar*)"windingmsg");
+ xmlNodeSetContent (node, (xmlChar*)msg);
level[0] = (int)'0' + SYS_ERR;
level[1] = 0;
- xmlSetProp (node, "level", (char *)&level);
+ xmlSetProp (node, (xmlChar*)"level", (xmlChar *)&level);
// a 'winding' node
sprintf( buf, "%i ", numpoints);
for(i = 0; i < numpoints; i++)
strcat( buf, smlbuf);
}
- winding = xmlNewNode (NULL, "winding");
- xmlNodeSetContent (winding, buf);
+ winding = xmlNewNode (NULL, (xmlChar*)"winding");
+ xmlNodeSetContent (winding, (xmlChar*)buf);
xmlAddChild (node, winding);
xml_SendNode (node);
char sMsg[1024];
Net_Setup();
- Net_StringToAddress((char *)dest, &address);
+ Net_StringToAddress(dest, &address);
brdcst_socket = Net_Connect(&address, 0);
if (brdcst_socket)
{
static qboolean bGotXML = qfalse;
char level[2];
- printf(buf);
+ printf("%s", buf);
// the following part is XML stuff only.. but maybe we don't want that message to go down the XML pipe?
if (flag == SYS_NOXML)
if (!bGotXML)
{
// initialize
- doc = xmlNewDoc("1.0");
- doc->children = xmlNewDocRawNode(doc, NULL, "q3map_feedback", NULL);
+ doc = xmlNewDoc((xmlChar*)"1.0");
+ doc->children = xmlNewDocRawNode(doc, NULL, (xmlChar*)"q3map_feedback", NULL);
bGotXML = qtrue;
}
- node = xmlNewNode (NULL, "message");
+ node = xmlNewNode (NULL, (xmlChar*)"message");
{
gchar* utf8 = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
- xmlNodeSetContent(node, utf8);
+ xmlNodeSetContent(node, (xmlChar*)utf8);
g_free(utf8);
}
level[0] = (int)'0' + flag;
level[1] = 0;
- xmlSetProp (node, "level", (char *)&level );
+ xmlSetProp (node, (xmlChar*)"level", (xmlChar *)&level );
xml_SendNode (node);
}
{
short v;
- fread( &v, sizeof(v), 1, fin );
+ if(fread( &v, sizeof(v), 1, fin ) != 1)
+ return UNZ_EOF;
*pX = __LittleShort( v);
return UNZ_OK;
{
int v;
- fread( &v, sizeof(v), 1, fin );
+ if(fread( &v, sizeof(v), 1, fin ) != 1)
+ return UNZ_EOF;
*pX = __LittleLong( v);
return UNZ_OK;
/* we check the magic */
if (err==UNZ_OK)
+ {
if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
err=UNZ_ERRNO;
else if (uMagic!=0x02014b50)
err=UNZ_BADZIPFILE;
+ }
if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK)
err=UNZ_ERRNO;
uSizeRead = extraFieldBufferSize;
if (lSeek!=0)
+ {
if (fseek(s->file,lSeek,SEEK_CUR)==0)
lSeek=0;
else
err=UNZ_ERRNO;
+ }
if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1)
err=UNZ_ERRNO;
uSizeRead = commentBufferSize;
if (lSeek!=0)
+ {
if (fseek(s->file,lSeek,SEEK_CUR)==0)
lSeek=0;
else
err=UNZ_ERRNO;
+ }
if ((file_info.size_file_comment>0) && (commentBufferSize>0))
if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1)
err=UNZ_ERRNO;
if (err==UNZ_OK)
+ {
if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
err=UNZ_ERRNO;
else if (uMagic!=0x04034b50)
err=UNZ_BADZIPFILE;
+ }
if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
err=UNZ_ERRNO;
/* compute minimum size table less than or equal to l bits */
z = g - w;
- z = z > (uInt)l ? l : z; /* table size upper limit */
+ z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */
if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
{ /* too few codes for k-w bit table */
f -= a + 1; /* deduct codes from patterns left */
/* set up table entry in r */
r.bits = (Byte)(k - w);
if (p >= v + n)
+ {
r.exop = 128 + 64; /* out of values--invalid code */
+ r.base = 0;
+ }
else if (*p < s)
{
r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */