Unified · Split
| @@ -9,7 +9,7 @@ AR=$(MING)ar · 8 unmodified lines | |||
| 9 | CC=$(MING)gcc | 9 | CC=$(MING)gcc |
| 10 | AS=$(MING)as | 10 | AS=$(MING)as |
| 11 | RANLIB=$(MING)ranlib | 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 | O=o | 13 | O=o |
| 14 | FS=fs-win32 | 14 | FS=fs-win32 |
| 15 | IP=win32 | 15 | IP=win32 |
| @@ -3,15 +3,16 @@ · 2 unmodified lines | |||
| 3 | #undef Rectangle | 3 | #undef Rectangle |
| 4 | #define Rectangle _Rectangle | 4 | #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 | ||
| 16 | Memimage *gscreen; | 17 | Memimage *gscreen; |
| 17 | Screeninfo screen; | 18 | Screeninfo screen; |
| @@ -31,14 +32,13 @@ static void winproc(void *); · 13 unmodified lines | |||
| 31 | static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); | 32 | static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); |
| 32 | static void paletteinit(void); | 33 | static void paletteinit(void); |
| 33 | static void bmiinit(void); | 34 | static void bmiinit(void); |
| 34 | static void screenload2(Rectangle r, int ldepth, uchar *p, Point pt, int step); | ||
| 35 | 35 | ||
| 36 | static int readybit; | 36 | static int readybit; |
| 37 | static Rendez rend; | 37 | static Rendez rend; |
| 38 | 38 | ||
| 39 | Point ZP; | 39 | Point ZP; |
| 40 | 40 | ||
| 41 | static | 41 | static int |
| 42 | isready(void*a) | 42 | isready(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 | ||
| 88 | uchar* | 88 | uchar* |
| @@ -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(); |
| @@ -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 | ||
| 17 | typedef __int64 p9_vlong; | 19 | typedef __int64 p9_vlong; |
| 18 | typedef unsigned __int64 p9_uvlong; | 20 | typedef unsigned __int64 p9_uvlong; |
| @@ -56,7 +56,6 @@ static void fspath(Chan*, char*, char*); · 55 unmodified lines | |||
| 56 | static ulong fsdirread(Chan*, uchar*, int, ulong); | 56 | static ulong fsdirread(Chan*, uchar*, int, ulong); |
| 57 | static int fsomode(int); | 57 | static int fsomode(int); |
| 58 | static int chown(char *path, int uid, int); | 58 | static int chown(char *path, int uid, int); |
| 59 | static 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 */ |
| 62 | static char* | 61 | static 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; |
| @@ -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 listen | 14 | #undef listen |
| 13 | #undef accept | 15 | #undef accept |
| @@ -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 | ||
| 165 | int | 165 | ulong |
| 166 | ticks(void) | 166 | ticks(void) |
| 167 | { | 167 | { |
| 168 | return GetTickCount(); | 168 | return GetTickCount(); |
| @@ -182,7 +182,6 @@ fastticks(uvlong *v) · 13 unmodified lines | |||
| 182 | #endif | 182 | #endif |
| 183 | 183 | ||
| 184 | extern int main(int, char*[]); | 184 | extern int main(int, char*[]); |
| 185 | static int args(char *argv[], int n, char *p); | ||
| 186 | 185 | ||
| 187 | int APIENTRY | 186 | int APIENTRY |
| 188 | WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, int nshow) | 187 | WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR arg, int nshow) |