History

silence gcc warnings

Russ Cox committed 21 years ago

Commit 494adee1 parent 1c8b4996 files · +22 −20Browse files

Unified · Split

6 files
  1. Make.win32 +1 −1
  2. gui-win32/screen.c +11 −11
  3. include/9windows.h +2 −0
  4. kern/devfs-win32.c +1 −2
  5. kern/devip-win32.c +2 −0
  6. kern/win32.c +5 −6
Make.win32+1−1
@@ -9,7 +9,7 @@ AR=$(MING)ar · 8 unmodified lines
99 CC=$(MING)gcc
1010 AS=$(MING)as
1111 RANLIB=$(MING)ranlib
12−CFLAGS=-I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS
12+CFLAGS=-Wall -Wno-missing-braces -I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS
1313 O=o
1414 FS=fs-win32
1515 IP=win32
gui-win32/screen.c+11−11
@@ -3,15 +3,16 @@ · 2 unmodified lines
33 #undef Rectangle
44 #define Rectangle _Rectangle
55
6−#include <u.h>
7−#include <libc.h>
8−#include <dat.h>
6+#include "u.h"
7+#include "lib.h"
8+#include "kern/dat.h"
9+#include "kern/fns.h"
10+#include "error.h"
11+#include "user.h"
912 #include <draw.h>
1013 #include <memdraw.h>
11−#include "error.h"
1214 #include "screen.h"
1315 #include "keyboard.h"
14−#include "fns.h"
1516
1617 Memimage *gscreen;
1718 Screeninfo screen;
@@ -31,14 +32,13 @@ static void winproc(void *); · 13 unmodified lines
3132 static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
3233 static void paletteinit(void);
3334 static void bmiinit(void);
34−static void screenload2(Rectangle r, int ldepth, uchar *p, Point pt, int step);
3535
3636 static int readybit;
3737 static Rendez rend;
3838
3939 Point ZP;
4040
41−static
41+static int
4242 isready(void*a)
4343 {
4444 return readybit;
@@ -82,7 +82,7 @@ screeninit(void) · 37 unmodified lines
8282
8383 gscreen = allocmemimage(Rect(0,0,dx,dy), fmt);
8484 kproc("winscreen", winproc, 0);
85− sleep(&rend, isready, 0);
85+ ksleep(&rend, isready, 0);
8686 }
8787
8888 uchar*
@@ -123,7 +123,7 @@ screenload(Rectangle r, int depth, uchar *p, Point pt, int step) · 34 unmodified lines
123123 if(rectclip(&r, gscreen->r) == 0)
124124 return;
125125
126− if(step&3 != 0 || ((pt.x*depth)%32) != 0 || (ulong)p&3 != 0)
126+ if((step&3) != 0 || ((pt.x*depth)%32) != 0 || ((ulong)p&3) != 0)
127127 panic("screenload: bad params %d %d %ux", step, pt.x, p);
128128 dx = r.max.x - r.min.x;
129129 dy = r.max.y - r.min.y;
@@ -574,9 +574,9 @@ clipread(void) · 444 unmodified lines
574574 return strdup("");
575575 }
576576
577− if(h = GetClipboardData(CF_UNICODETEXT))
577+ if((h = GetClipboardData(CF_UNICODETEXT)))
578578 p = clipreadunicode(h);
579− else if(h = GetClipboardData(CF_TEXT))
579+ else if((h = GetClipboardData(CF_TEXT)))
580580 p = clipreadutf(h);
581581 else {
582582 oserror();
include/9windows.h+2−0
@@ -12,7 +12,9 @@ · 11 unmodified lines
1212 #include <stdarg.h>
1313
1414 /* disable various silly warnings */
15+#ifdef MSVC
1516 #pragma warning( disable : 4245 4305 4244 4102 4761 4090 4028 4024)
17+#endif
1618
1719 typedef __int64 p9_vlong;
1820 typedef unsigned __int64 p9_uvlong;
kern/devfs-win32.c+1−2
@@ -56,7 +56,6 @@ static void fspath(Chan*, char*, char*); · 55 unmodified lines
5656 static ulong fsdirread(Chan*, uchar*, int, ulong);
5757 static int fsomode(int);
5858 static int chown(char *path, int uid, int);
59−static int link(char *path, char *next);
6059
6160 /* clumsy hack, but not worse than the Path stuff in the last one */
6261 static char*
@@ -132,7 +131,7 @@ fswalk1(Chan *c, char *name) · 69 unmodified lines
132131
133132 fspath(c, name, path);
134133
135− /* print("** fs walk '%s' -> %s\n", path, name); /**/
134+ /* print("** fs walk '%s' -> %s\n", path, name); */
136135
137136 if(stat(path, &stbuf) < 0)
138137 return 0;
kern/devip-win32.c+2−0
@@ -7,7 +7,9 @@ · 6 unmodified lines
77
88 #include "devip.h"
99
10+#ifdef MSVC
1011 #pragma comment(lib, "wsock32.lib")
12+#endif
1113
1214 #undef listen
1315 #undef accept
kern/win32.c+5−6
@@ -54,7 +54,7 @@ osinit(void) · 53 unmodified lines
5454 t->sema = CreateSemaphore(0, 0, 1000, 0);
5555 if(t->sema == 0) {
5656 oserror();
57− fatal("could not create semaphore: %r");
57+ panic("could not create semaphore: %r");
5858 }
5959 }
6060
@@ -67,7 +67,7 @@ osnewproc(Proc *p) · 6 unmodified lines
6767 op->sema = CreateSemaphore(0, 0, 1000, 0);
6868 if (op->sema == 0) {
6969 oserror();
70− fatal("could not create semaphore: %r");
70+ panic("could not create semaphore: %r");
7171 }
7272 }
7373
@@ -92,7 +92,7 @@ osproc(Proc *p) · 18 unmodified lines
9292
9393 if(CreateThread(0, 0, tramp, p, 0, &tid) == 0) {
9494 oserror();
95− fatal("osproc: %r");
95+ panic("osproc: %r");
9696 }
9797
9898 Sleep(0);
@@ -109,7 +109,7 @@ tramp(LPVOID vp) · 10 unmodified lines
109109 op->sema = CreateSemaphore(0, 0, 1000, 0);
110110 if(op->sema == 0) {
111111 oserror();
112− fatal("could not create semaphore: %r");
112+ panic("could not create semaphore: %r");
113113 }
114114
115115 (*p->fn)(p->arg);
@@ -162,7 +162,7 @@ seconds(void) · 46 unmodified lines
162162 return time(0);
163163 }
164164
165−int
165+ulong
166166 ticks(void)
167167 {
168168 return GetTickCount();
@@ -182,7 +182,6 @@ fastticks(uvlong *v) · 13 unmodified lines
182182 #endif
183183
184184 extern int main(int, char*[]);
185−static int args(char *argv[], int n, char *p);
186185
187186 int APIENTRY
188187 WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, int nshow)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t