silence gcc warnings

This commit is contained in:
Russ Cox 2005-11-07 17:21:23 +00:00
parent 1c8b499228
commit 494adeed0b
6 changed files with 22 additions and 20 deletions

View File

@ -9,7 +9,7 @@ AR=$(MING)ar
CC=$(MING)gcc
AS=$(MING)as
RANLIB=$(MING)ranlib
CFLAGS=-I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS
CFLAGS=-Wall -Wno-missing-braces -I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS
O=o
FS=fs-win32
IP=win32

View File

@ -3,15 +3,16 @@
#undef Rectangle
#define Rectangle _Rectangle
#include <u.h>
#include <libc.h>
#include <dat.h>
#include "u.h"
#include "lib.h"
#include "kern/dat.h"
#include "kern/fns.h"
#include "error.h"
#include "user.h"
#include <draw.h>
#include <memdraw.h>
#include "error.h"
#include "screen.h"
#include "keyboard.h"
#include "fns.h"
Memimage *gscreen;
Screeninfo screen;
@ -31,14 +32,13 @@ static void winproc(void *);
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static void paletteinit(void);
static void bmiinit(void);
static void screenload2(Rectangle r, int ldepth, uchar *p, Point pt, int step);
static int readybit;
static Rendez rend;
Point ZP;
static
static int
isready(void*a)
{
return readybit;
@ -82,7 +82,7 @@ screeninit(void)
gscreen = allocmemimage(Rect(0,0,dx,dy), fmt);
kproc("winscreen", winproc, 0);
sleep(&rend, isready, 0);
ksleep(&rend, isready, 0);
}
uchar*
@ -123,7 +123,7 @@ screenload(Rectangle r, int depth, uchar *p, Point pt, int step)
if(rectclip(&r, gscreen->r) == 0)
return;
if(step&3 != 0 || ((pt.x*depth)%32) != 0 || (ulong)p&3 != 0)
if((step&3) != 0 || ((pt.x*depth)%32) != 0 || ((ulong)p&3) != 0)
panic("screenload: bad params %d %d %ux", step, pt.x, p);
dx = r.max.x - r.min.x;
dy = r.max.y - r.min.y;
@ -574,9 +574,9 @@ clipread(void)
return strdup("");
}
if(h = GetClipboardData(CF_UNICODETEXT))
if((h = GetClipboardData(CF_UNICODETEXT)))
p = clipreadunicode(h);
else if(h = GetClipboardData(CF_TEXT))
else if((h = GetClipboardData(CF_TEXT)))
p = clipreadutf(h);
else {
oserror();

View File

@ -12,7 +12,9 @@
#include <stdarg.h>
/* disable various silly warnings */
#ifdef MSVC
#pragma warning( disable : 4245 4305 4244 4102 4761 4090 4028 4024)
#endif
typedef __int64 p9_vlong;
typedef unsigned __int64 p9_uvlong;

View File

@ -56,7 +56,6 @@ static void fspath(Chan*, char*, char*);
static ulong fsdirread(Chan*, uchar*, int, ulong);
static int fsomode(int);
static int chown(char *path, int uid, int);
static int link(char *path, char *next);
/* clumsy hack, but not worse than the Path stuff in the last one */
static char*
@ -132,7 +131,7 @@ fswalk1(Chan *c, char *name)
fspath(c, name, path);
/* print("** fs walk '%s' -> %s\n", path, name); /**/
/* print("** fs walk '%s' -> %s\n", path, name); */
if(stat(path, &stbuf) < 0)
return 0;

View File

@ -7,7 +7,9 @@
#include "devip.h"
#ifdef MSVC
#pragma comment(lib, "wsock32.lib")
#endif
#undef listen
#undef accept

View File

@ -54,7 +54,7 @@ osinit(void)
t->sema = CreateSemaphore(0, 0, 1000, 0);
if(t->sema == 0) {
oserror();
fatal("could not create semaphore: %r");
panic("could not create semaphore: %r");
}
}
@ -67,7 +67,7 @@ osnewproc(Proc *p)
op->sema = CreateSemaphore(0, 0, 1000, 0);
if (op->sema == 0) {
oserror();
fatal("could not create semaphore: %r");
panic("could not create semaphore: %r");
}
}
@ -92,7 +92,7 @@ osproc(Proc *p)
if(CreateThread(0, 0, tramp, p, 0, &tid) == 0) {
oserror();
fatal("osproc: %r");
panic("osproc: %r");
}
Sleep(0);
@ -109,7 +109,7 @@ tramp(LPVOID vp)
op->sema = CreateSemaphore(0, 0, 1000, 0);
if(op->sema == 0) {
oserror();
fatal("could not create semaphore: %r");
panic("could not create semaphore: %r");
}
(*p->fn)(p->arg);
@ -162,7 +162,7 @@ seconds(void)
return time(0);
}
int
ulong
ticks(void)
{
return GetTickCount();
@ -182,7 +182,6 @@ fastticks(uvlong *v)
#endif
extern int main(int, char*[]);
static int args(char *argv[], int n, char *p);
int APIENTRY
WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, int nshow)