Skip to content

Commit c4ed11f

Browse files
ketmarCyberShadow
authored andcommitted
alot of fixes
1 parent 5e64843 commit c4ed11f

File tree

12 files changed

+2601
-2603
lines changed

12 files changed

+2601
-2603
lines changed

deimos/X11/X.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ enum {
187187
NotifyUngrab = 2,
188188
NotifyWhileGrabbed = 3
189189
}
190-
const int NotifyHint = 1; /* for MotionNotify events */
190+
enum NotifyHint = 1; /* for MotionNotify events */
191191

192192
/* Notify detail */
193193
enum {

deimos/X11/Xlib.d

Lines changed: 130 additions & 137 deletions
Large diffs are not rendered by default.

deimos/X11/Xlibint.d

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -351,33 +351,33 @@ else{
351351
void* Xcalloc( int nelem, size_t elsize){ return calloc(nelem, elsize); }
352352
}
353353

354-
const int LOCKED = 1;
355-
const int UNLOCKED = 0;
354+
enum LOCKED = 1;
355+
enum UNLOCKED = 0;
356356

357-
const int BUFSIZE = 2048; /* X output buffer size. */
358-
const int PTSPERBATCH = 1024; /* point batching */
359-
const int WLNSPERBATCH = 50; /* wide line batching */
360-
const int ZLNSPERBATCH = 1024; /* thin line batching */
361-
const int WRCTSPERBATCH = 10; /* wide line rectangle batching */
362-
const int ZRCTSPERBATCH = 256; /* thin line rectangle batching */
363-
const int FRCTSPERBATCH = 256; /* filled rectangle batching */
364-
const int FARCSPERBATCH = 256; /* filled arc batching */
365-
const string CURSORFONT = "cursor"; /* standard cursor fonts */
357+
enum BUFSIZE = 2048; /* X output buffer size. */
358+
enum PTSPERBATCH = 1024; /* point batching */
359+
enum WLNSPERBATCH = 50; /* wide line batching */
360+
enum ZLNSPERBATCH = 1024; /* thin line batching */
361+
enum WRCTSPERBATCH = 10; /* wide line rectangle batching */
362+
enum ZRCTSPERBATCH = 256; /* thin line rectangle batching */
363+
enum FRCTSPERBATCH = 256; /* filled rectangle batching */
364+
enum FARCSPERBATCH = 256; /* filled arc batching */
365+
immutable char* CURSORFONT = "cursor"; /* standard cursor fonts */
366366

367367

368368
/*
369369
* Display flags
370370
*/
371-
enum {
372-
XlibDisplayIOError = 1L << 0,
373-
XlibDisplayClosing = 1L << 1,
374-
XlibDisplayNoXkb = 1L << 2,
375-
XlibDisplayPrivSync = 1L << 3,
376-
XlibDisplayProcConni = 1L << 4, /* in _XProcessInternalConnection */
377-
XlibDisplayReadEvents = 1L << 5, /* in _XReadEvents */
378-
XlibDisplayReply = 1L << 5, /* in _XReply */
379-
XlibDisplayWriting = 1L << 6, /* in _XFlushInt, _XSend */
380-
XlibDisplayDfltRMDB = 1L << 7 /* mark if RM db from XGetDefault */
371+
enum : c_ulong {
372+
XlibDisplayIOError = 1 << 0,
373+
XlibDisplayClosing = 1 << 1,
374+
XlibDisplayNoXkb = 1 << 2,
375+
XlibDisplayPrivSync = 1 << 3,
376+
XlibDisplayProcConni = 1 << 4, /* in _XProcessInternalConnection */
377+
XlibDisplayReadEvents = 1 << 5, /* in _XReadEvents */
378+
XlibDisplayReply = 1 << 5, /* in _XReply */
379+
XlibDisplayWriting = 1 << 6, /* in _XFlushInt, _XSend */
380+
XlibDisplayDfltRMDB = 1 << 7 /* mark if RM db from XGetDefault */
381381
}
382382

383383
/*

deimos/X11/Xmd.d

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,26 @@ alias CARD8 BOOL;
9696
* definitions for sign-extending bitfields on 64-bit architectures
9797
*/
9898
static if( WORD64 ){
99-
template cvtINT8toInt(INT8 val) { const int cvtINT8toInt = cast(int) (val & 0x00000080) ? (val | 0xffffffffffffff00) : val; }
100-
template cvtINT16toInt(INT16 val) { const int cvtINT16toInt = cast(int) (val & 0x00008000) ? (val | 0xffffffffffff0000) : val; }
101-
template cvtINT32toInt(INT32 val) { const int cvtINT32toInt = cast(int) (val & 0x80000000) ? (val | 0xffffffff00000000) : val; }
102-
template cvtINT8toShort(INT8 val) { const short cvtINT8toShort = cast(short) cvtINT8toInt(val); }
103-
template cvtINT16toShort(INT16 val) { const short cvtINT16toShort = cast(short) cvtINT16toInt(val); }
104-
template cvtINT32toShort(INT32 val) { const short cvtINT32toShort = cast(short) cvtINT32toInt(val); }
105-
template cvtINT8toLong(INT8 val) { const c_long cvtINT8toLong = cast(c_long) cvtINT8toInt(val); }
106-
template cvtINT16toLong(INT16 val) { const c_long cvtINT16toLong = cast(c_long) cvtINT16toInt(val); }
107-
template cvtINT32toLong(INT32 val) { const c_long cvtINT32toLong = cast(c_long) cvtINT32toInt(val); }
99+
template cvtINT8toInt(INT8 val) { enum cvtINT8toInt = cast(int) (val & 0x00000080) ? (val | 0xffffffffffffff00) : val; }
100+
template cvtINT16toInt(INT16 val) { enum cvtINT16toInt = cast(int) (val & 0x00008000) ? (val | 0xffffffffffff0000) : val; }
101+
template cvtINT32toInt(INT32 val) { enum cvtINT32toInt = cast(int) (val & 0x80000000) ? (val | 0xffffffff00000000) : val; }
102+
template cvtINT8toShort(INT8 val) { enum cvtINT8toShort = cast(short) cvtINT8toInt(val); }
103+
template cvtINT16toShort(INT16 val) { enum cvtINT16toShort = cast(short) cvtINT16toInt(val); }
104+
template cvtINT32toShort(INT32 val) { enum cvtINT32toShort = cast(short) cvtINT32toInt(val); }
105+
template cvtINT8toLong(INT8 val) { enum cvtINT8toLong = cast(c_long) cvtINT8toInt(val); }
106+
template cvtINT16toLong(INT16 val) { enum cvtINT16toLong = cast(c_long) cvtINT16toInt(val); }
107+
template cvtINT32toLong(INT32 val) { enum cvtINT32toLong = cast(c_long) cvtINT32toInt(val); }
108108
}
109109
else{ /* WORD64 and UNSIGNEDBITFIELDS */
110-
template cvtINT8toInt(INT8 val) { const int cvtINT8toInt = cast(int) val; }
111-
template cvtINT16toInt(INT16 val) { const int cvtINT16toInt = cast(int) val; }
112-
template cvtINT32toInt(INT32 val) { const int cvtINT32toInt = cast(int) val; }
113-
template cvtINT8toShort(INT8 val) { const short cvtINT8toShort = cast(short) val; }
114-
template cvtINT16toShort(INT16 val) { const short cvtINT16toShort = cast(short) val; }
115-
template cvtINT32toShort(INT32 val) { const short cvtINT32toShort = cast(short) val; }
116-
template cvtINT8toLong(INT8 val) { const c_long cvtINT8toLong = cast(c_long) val; }
117-
template cvtINT16toLong(INT16 val) { const c_long cvtINT16toLong = cast(c_long) val; }
118-
template cvtINT32toLong(INT32 val) { const c_long cvtINT32toLong = cast(c_long) val; }
110+
template cvtINT8toInt(INT8 val) { enum cvtINT8toInt = cast(int) val; }
111+
template cvtINT16toInt(INT16 val) { enum cvtINT16toInt = cast(int) val; }
112+
template cvtINT32toInt(INT32 val) { enum cvtINT32toInt = cast(int) val; }
113+
template cvtINT8toShort(INT8 val) { enum cvtINT8toShort = cast(short) val; }
114+
template cvtINT16toShort(INT16 val) { enum cvtINT16toShort = cast(short) val; }
115+
template cvtINT32toShort(INT32 val) { enum cvtINT32toShort = cast(short) val; }
116+
template cvtINT8toLong(INT8 val) { enum cvtINT8toLong = cast(c_long) val; }
117+
template cvtINT16toLong(INT16 val) { enum cvtINT16toLong = cast(c_long) val; }
118+
template cvtINT32toLong(INT32 val) { enum cvtINT32toLong = cast(c_long) val; }
119119
}
120120

121121

@@ -133,3 +133,6 @@ else{/* else not MUSTCOPY, this is used for 32-bit machines */
133133
*/
134134
T NEXTPTR(T)(T p){ const T NEXTPTR = p + 1; }
135135
}/* MUSTCOPY - used machines whose C structs don't line up with proto */
136+
137+
138+
alias wchar_t = dchar;

0 commit comments

Comments
 (0)