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
9CC=$(MING)gcc9CC=$(MING)gcc
10AS=$(MING)as10AS=$(MING)as
11RANLIB=$(MING)ranlib11RANLIB=$(MING)ranlib
12CFLAGS=-I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS12CFLAGS=-Wall -Wno-missing-braces -I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -D_X86_ -DIS_32 -DWINDOWS
13O=o13O=o
14FS=fs-win3214FS=fs-win32
15IP=win3215IP=win32
gui-win32/screen.c+11−11
@@ -3,15 +3,16 @@ · 2 unmodified lines
3#undef Rectangle3#undef Rectangle
4#define Rectangle _Rectangle4#define Rectangle _Rectangle
5 5
6#include <u.h>6#include "u.h"
7#include <libc.h>7#include "lib.h"
8#include <dat.h>8#include "kern/dat.h"
9#include "kern/fns.h"
10#include "error.h"
11#include "user.h"
9#include <draw.h>12#include <draw.h>
10#include <memdraw.h>13#include <memdraw.h>
11#include "error.h"
12#include "screen.h"14#include "screen.h"
13#include "keyboard.h"15#include "keyboard.h"
14#include "fns.h"
15 16
16Memimage *gscreen;17Memimage *gscreen;
17Screeninfo screen;18Screeninfo screen;
@@ -31,14 +32,13 @@ static void winproc(void *); · 13 unmodified lines
31static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);32static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
32static void paletteinit(void);33static void paletteinit(void);
33static void bmiinit(void);34static void bmiinit(void);
34static void screenload2(Rectangle r, int ldepth, uchar *p, Point pt, int step);
35 35
36static int readybit;36static int readybit;
37static Rendez rend;37static Rendez rend;
38 38
39Point ZP;39Point ZP;
40 40
41static41static int
42isready(void*a)42isready(void*a)
43{43{
44 return readybit;44 return readybit;
@@ -82,7 +82,7 @@ screeninit(void) · 37 unmodified lines
82 82
83 gscreen = allocmemimage(Rect(0,0,dx,dy), fmt);83 gscreen = allocmemimage(Rect(0,0,dx,dy), fmt);
84 kproc("winscreen", winproc, 0);84 kproc("winscreen", winproc, 0);
85 sleep(&rend, isready, 0);85 ksleep(&rend, isready, 0);
86}86}
87 87
88uchar*88uchar*
@@ -123,7 +123,7 @@ screenload(Rectangle r, int depth, uchar *p, Point pt, int step) · 34 unmodified lines
123 if(rectclip(&r, gscreen->r) == 0)123 if(rectclip(&r, gscreen->r) == 0)
124 return;124 return;
125 125
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)
127 panic("screenload: bad params %d %d %ux", step, pt.x, p);127 panic("screenload: bad params %d %d %ux", step, pt.x, p);
128 dx = r.max.x - r.min.x;128 dx = r.max.x - r.min.x;
129 dy = r.max.y - r.min.y;129 dy = r.max.y - r.min.y;
@@ -574,9 +574,9 @@ clipread(void) · 444 unmodified lines
574 return strdup("");574 return strdup("");
575 }575 }
576 576
577 if(h = GetClipboardData(CF_UNICODETEXT))577 if((h = GetClipboardData(CF_UNICODETEXT)))
578 p = clipreadunicode(h);578 p = clipreadunicode(h);
579 else if(h = GetClipboardData(CF_TEXT))579 else if((h = GetClipboardData(CF_TEXT)))
580 p = clipreadutf(h);580 p = clipreadutf(h);
581 else {581 else {
582 oserror();582 oserror();
include/9windows.h+2−0
@@ -12,7 +12,9 @@ · 11 unmodified lines
12#include <stdarg.h>12#include <stdarg.h>
13 13
14/* disable various silly warnings */14/* disable various silly warnings */
15#ifdef MSVC
15#pragma warning( disable : 4245 4305 4244 4102 4761 4090 4028 4024)16#pragma warning( disable : 4245 4305 4244 4102 4761 4090 4028 4024)
17#endif
16 18
17typedef __int64 p9_vlong;19typedef __int64 p9_vlong;
18typedef unsigned __int64 p9_uvlong;20typedef unsigned __int64 p9_uvlong;
kern/devfs-win32.c+1−2
@@ -56,7 +56,6 @@ static void fspath(Chan*, char*, char*); · 55 unmodified lines
56static ulong fsdirread(Chan*, uchar*, int, ulong);56static ulong fsdirread(Chan*, uchar*, int, ulong);
57static int fsomode(int);57static int fsomode(int);
58static int chown(char *path, int uid, int);58static int chown(char *path, int uid, int);
59static int link(char *path, char *next);
60 59
61/* clumsy hack, but not worse than the Path stuff in the last one */60/* clumsy hack, but not worse than the Path stuff in the last one */
62static char*61static char*
@@ -132,7 +131,7 @@ fswalk1(Chan *c, char *name) · 69 unmodified lines
132 131
133 fspath(c, name, path);132 fspath(c, name, path);
134 133
135 /* print("** fs walk '%s' -> %s\n", path, name); /**/134 /* print("** fs walk '%s' -> %s\n", path, name); */
136 135
137 if(stat(path, &stbuf) < 0)136 if(stat(path, &stbuf) < 0)
138 return 0;137 return 0;
kern/devip-win32.c+2−0
@@ -7,7 +7,9 @@ · 6 unmodified lines
7 7
8#include "devip.h"8#include "devip.h"
9 9
10#ifdef MSVC
10#pragma comment(lib, "wsock32.lib")11#pragma comment(lib, "wsock32.lib")
12#endif
11 13
12#undef listen14#undef listen
13#undef accept15#undef accept
kern/win32.c+5−6
@@ -54,7 +54,7 @@ osinit(void) · 53 unmodified lines
54 t->sema = CreateSemaphore(0, 0, 1000, 0);54 t->sema = CreateSemaphore(0, 0, 1000, 0);
55 if(t->sema == 0) {55 if(t->sema == 0) {
56 oserror();56 oserror();
57 fatal("could not create semaphore: %r");57 panic("could not create semaphore: %r");
58 }58 }
59}59}
60 60
@@ -67,7 +67,7 @@ osnewproc(Proc *p) · 6 unmodified lines
67 op->sema = CreateSemaphore(0, 0, 1000, 0);67 op->sema = CreateSemaphore(0, 0, 1000, 0);
68 if (op->sema == 0) {68 if (op->sema == 0) {
69 oserror();69 oserror();
70 fatal("could not create semaphore: %r");70 panic("could not create semaphore: %r");
71 }71 }
72}72}
73 73
@@ -92,7 +92,7 @@ osproc(Proc *p) · 18 unmodified lines
92 92
93 if(CreateThread(0, 0, tramp, p, 0, &tid) == 0) {93 if(CreateThread(0, 0, tramp, p, 0, &tid) == 0) {
94 oserror();94 oserror();
95 fatal("osproc: %r");95 panic("osproc: %r");
96 }96 }
97 97
98 Sleep(0);98 Sleep(0);
@@ -109,7 +109,7 @@ tramp(LPVOID vp) · 10 unmodified lines
109 op->sema = CreateSemaphore(0, 0, 1000, 0);109 op->sema = CreateSemaphore(0, 0, 1000, 0);
110 if(op->sema == 0) {110 if(op->sema == 0) {
111 oserror();111 oserror();
112 fatal("could not create semaphore: %r");112 panic("could not create semaphore: %r");
113 }113 }
114 114
115 (*p->fn)(p->arg);115 (*p->fn)(p->arg);
@@ -162,7 +162,7 @@ seconds(void) · 46 unmodified lines
162 return time(0);162 return time(0);
163}163}
164 164
165int165ulong
166ticks(void)166ticks(void)
167{167{
168 return GetTickCount();168 return GetTickCount();
@@ -182,7 +182,6 @@ fastticks(uvlong *v) · 13 unmodified lines
182#endif182#endif
183 183
184extern int main(int, char*[]);184extern int main(int, char*[]);
185static int args(char *argv[], int n, char *p);
186 185
187int APIENTRY186int APIENTRY
188WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, int nshow)187WinMain(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