ref: 494adeed0b1e2afdf696baeff995ee80e0f37e8b
parent: 1c8b4992284fe1cbccb54cd213f274c00c3ac6d1
author: Russ Cox <[email protected]>
date: Mon Nov 7 12:21:23 EST 2005
silence gcc warnings
--- a/Make.win32
+++ b/Make.win32
@@ -9,7 +9,7 @@
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
--- a/gui-win32/screen.c
+++ b/gui-win32/screen.c
@@ -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,7 +32,6 @@
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;
@@ -38,7 +38,7 @@
Point ZP;
-static
+static int
isready(void*a)
{
return readybit;
@@ -82,7 +82,7 @@
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 @@
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 @@
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();
--- a/include/9windows.h
+++ b/include/9windows.h
@@ -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;
--- a/kern/devfs-win32.c
+++ b/kern/devfs-win32.c
@@ -56,7 +56,6 @@
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 @@
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;
--- a/kern/devip-win32.c
+++ b/kern/devip-win32.c
@@ -7,7 +7,9 @@
#include "devip.h"
+#ifdef MSVC
#pragma comment(lib, "wsock32.lib")
+#endif
#undef listen
#undef accept
--- a/kern/win32.c
+++ b/kern/win32.c
@@ -54,7 +54,7 @@
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 @@
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 @@
if(CreateThread(0, 0, tramp, p, 0, &tid) == 0) {
oserror();
- fatal("osproc: %r");
+ panic("osproc: %r");
}
Sleep(0);
@@ -109,7 +109,7 @@
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 @@
return time(0);
}
-int
+ulong
ticks(void)
{
return GetTickCount();
@@ -182,7 +182,6 @@
#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)