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