compiler fixes

This commit is contained in:
Kelvin Sherlock 2013-08-11 00:42:57 -04:00
parent b8cc6ee43a
commit 4e96ff9651
4 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,7 @@
#pragma optimize 79 #pragma optimize 79
#pragma noroot #pragma noroot
#include <GSOS.h>
#include <Memory.h> #include <Memory.h>
#include <MiscTool.h> #include <MiscTool.h>
#include <tcpip.h> #include <tcpip.h>
@ -354,7 +355,7 @@ int do_gopher(const char *url, URLComponents *components)
return -1; return -1;
} }
if (parse_extension(filename, &FileInfo.fileType, &FileInfo.auxType)) if (parse_extension_c(filename, &FileInfo.fileType, &FileInfo.auxType))
{ {
FileAttr |= ATTR_FILETYPE | ATTR_AUXTYPE; FileAttr |= ATTR_FILETYPE | ATTR_AUXTYPE;
setfileattr(filename, &FileInfo, FileAttr); setfileattr(filename, &FileInfo, FileAttr);

14
http.c
View File

@ -22,6 +22,7 @@
#include <Memory.h> #include <Memory.h>
#include <IntMath.h> #include <IntMath.h>
#include <TimeTool.h> #include <TimeTool.h>
#include <GSOS.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -371,7 +372,7 @@ int read_response(Word ipid, FILE *file, Handle dict)
* a file type / aux type. * a file type / aux type.
* *
*/ */
value = DictionaryGet(dict, "Content-Type", 12, &valueSize) value = DictionaryGet(dict, "Content-Type", 12, &valueSize);
if (value && valueSize) if (value && valueSize)
{ {
int i; int i;
@ -416,7 +417,7 @@ int read_response(Word ipid, FILE *file, Handle dict)
struct { struct {
LongWord lo; LongWord lo;
LongWord hi; LongWord hi;
} comp; } xcomp;
*pstring = valueSize; *pstring = valueSize;
memcpy(pstring + 1, value, valueSize); memcpy(pstring + 1, value, valueSize);
@ -430,10 +431,11 @@ int read_response(Word ipid, FILE *file, Handle dict)
// then use ConvSeconds to get the date // then use ConvSeconds to get the date
// this should handle timezones. // this should handle timezones.
tiDateString2Sec(&comp, pstring, 0x0e00); tiDateString2Sec(&xcomp, pstring, 0x0e00);
if (!_toolErr && hi == 0) if (!_toolErr && xcomp.hi == 0)
{ {
ConvSeconds(secs2TimeRec, comp.lo, &FileInfo.modDateTime); ConvSeconds(secs2TimeRec, (Long)xcomp.lo,
(Pointer)&FileInfo.modDateTime);
FileAttr |= ATTR_MODTIME; FileAttr |= ATTR_MODTIME;
haveTime = 1; haveTime = 1;
} }
@ -571,7 +573,7 @@ static int do_http_1_1(
cookie = 0; cookie = 0;
while ((cookie = DictionaryEnumerate(dict, &e, cookie))) while ((cookie = DictionaryEnumerate(dict, &e, cookie)))
{ {
s16_debug_printf("%.*s -> %.*s", s16_debug_printf("%.*s -> %.*s\n",
e.keySize, e.key, e.valueSize, e.value); e.keySize, e.key, e.valueSize, e.value);
} }
#endif #endif

View File

@ -27,7 +27,7 @@ int parse_extension_c(const char *cp, Word *ftype, LongWord *atype);
int parse_extension(const char *cp, Word size, Word *ftype, LongWord *atype); int parse_extension(const char *cp, Word size, Word *ftype, LongWord *atype);
int parse_mime_c(const char *cp, Word *ftype, LongWord *atype); int parse_mime_c(const char *cp, Word *ftype, LongWord *atype);
int parse_mime(const char *cp, Word size, Word *ftype, LongWord *atype) int parse_mime(const char *cp, Word size, Word *ftype, LongWord *atype);
#ifdef __GSOS__ #ifdef __GSOS__
@ -39,7 +39,7 @@ enum {
ATTR_MODTIME = 16 ATTR_MODTIME = 16
}; };
int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags) int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags);
#endif #endif

View File

@ -5,6 +5,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <gno/gno.h> #include <gno/gno.h>
#include "prototypes.h"
int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags) int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags)
{ {
Word rv; Word rv;