1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-05-02 06:36:04 +00:00

Net reduction of about 150 warnings when compiling with clang 15.0.6

devif.h, mnxdefs.h:
Update MRegion to reflect that width/height are unsigned.
Update ...EventMask fields in XWINDOW section of DspInterfaceRec to match parameter
   type used in XSelectInput() to which they are passed.
Add padding to explicitly align colors field (short among longs)

xbitmaps.h:
Reorder fields in LISP_CURSOR struct to avoid requiring padding for alignment
   constraints, and adjust initialization to match.
Declare cursors static const.
Move Lisp_Icon from xbitmaps.h to xmkicon.c

xinit.c, xinitdefs.h
Replace bound() (xwinmandefs.h) with static inline unsigned ubound() in xinit.c
Change signature of X_init() to use unsigned values for width, height, depth.
Add casts where necessary to avoid implicit signedness conversions.
Add extern declarations for all globals defined in xinit.c

xwinman.c, xwinmandefs.h
Remove bound() from xwinmandefs.h and use static inline unsigned ubound() in xwinman.c
Change signature of lisp_Xconfigure() to use unsigned width and height parameters.
Make GravSize unsigned to match its usage context.
Add casts where necessary to avoid implicit signedness conversions.
Add missing break to correct switch case fall-through warning.

dspif.c
Change LispDisplayRequestedWidth/Height to unsigned to reflect context of use.

xlspwin.c
Eliminate declaration for unused XEvent report.
Move global variable gcv, used only locally, to local variable in the procedures where needed.
Change various variables used in width/height calculation to unsigned to match usage context.
Add casts where necessary to avoid implicit signedness conversions.

xmkicon.c
Move Lisp_Icon from xbitmaps.h to xmkicon.c.
Move global XImage IconImage to local in function where it is required.
Add cast where necessary to avoid implicit signedness conversions.

xrdopt.c
Remove incorrect casts for signedness causing implicit sign conversion warnings.
Add extern declarations for all globals defined in xrdopt.c

xscroll.c
Replace bound() (xwinmandefs.h) with static inline signed sbound() in xscroll.c

initdsp.c, initdspdefs.h
Change signedness of various display variables from int to unsigned.
Change signature of init_display2() to unsigned display_max.
Add extern declarations for some globals defined in initdsp.c

xbbt.c
Add explicit casts for type warnings from MRegion width/height change.
Add explicit casts for type warnings in arguments to XPutImage().
This commit is contained in:
Nick Briggs
2022-12-09 16:20:14 -08:00
parent e122d894f9
commit 60e13a774d
15 changed files with 253 additions and 216 deletions

View File

@@ -52,8 +52,8 @@ typedef struct
{
int x;
int y;
int width;
int height;
unsigned width;
unsigned height;
} MRegion;
@@ -216,8 +216,9 @@ typedef struct
This method makes the mouse visible on the screen. Note that
the dsp supplies the method and the iop supplies the data. */
MRegion Display; /* Dimensions of the physical display. */
unsigned short unused0; /* alignment padding for next field */
unsigned short bitsperpixel;
unsigned long colors; /* cash for the available_colors */
unsigned long colors; /* cache for the available_colors */
unsigned long oldstate; /* Keep the old state around */
unsigned long graphicsmode; /* Magic cookie used to set the state. */
unsigned long numberofbanks;
@@ -256,8 +257,8 @@ typedef struct
Pixmap GravityOnPixmap;
Pixmap GravityOffPixmap;
XImage ScreenBitmap;
Mask DisableEventMask;
Mask EnableEventMask;
long DisableEventMask;
long EnableEventMask;
#endif /* XWINDOW */
} DspInterfaceRec, *DspInterface;

View File

@@ -5,7 +5,7 @@
void init_cursor(void);
void set_cursor(void);
void clear_display(void);
void init_display2(DLword *display_addr, int display_max);
void init_display2(DLword *display_addr, unsigned display_max);
void display_before_exit(void);
void flush_display_buffer(void);
void flush_display_region(int x, int y, int w, int h);

View File

@@ -216,8 +216,8 @@ typedef struct dspifrec
{
int error; /* A generic errornumber */
Display *handle; /* The X Display this dspif describes */
Mask DisableEventMask;
Mask EnableEventMask;
long DisableEventMask;
long EnableEventMask;
XImage image; /* The scratch image structure (used in blt'ing) */
XImage tmpimage; /* The tmp image (used for depth conversion) */
GC TitleGC; /* The gc for title blitting. */

View File

@@ -17,9 +17,9 @@
typedef struct {
short cubitsprepixel; /* bits per pixel in the cursor, mostly 1 */
const uint8_t *cuimage; /* the image bitmap */
const uint8_t *cumask; /* the mask bitmap */
short cubitsperpixel; /* bits per pixel in the cursor, mostly 1 */
short cuhotspotx; /* hot-spot X coordinate */
short cuhotspoty; /* hot-spot Y coordinate */
short cudata; /* ?? */
@@ -33,11 +33,11 @@ static const uint8_t defaultcursor_bitmap[]=
, 0x06, 0, 0x06, 0, 0x03, 0, 0x03, 0
};
LISP_CURSOR default_cursor =
static const LISP_CURSOR default_cursor =
{
1
, defaultcursor_bitmap
defaultcursor_bitmap
, defaultcursor_bitmap
, 1
, 0
, 15
, 0
@@ -52,11 +52,11 @@ static const uint8_t waitcursor_bitmap[]=
, 0x37, 0xD8, 0x67, 0xEC, 0xFF, 0xFE, 0xFF, 0xFE
};
LISP_CURSOR wait_cursor =
static const LISP_CURSOR wait_cursor =
{
1
, waitcursor_bitmap
waitcursor_bitmap
, waitcursor_bitmap
, 1
, 7
, 8
, 0
@@ -81,10 +81,10 @@ static const uint8_t horizscrollcursor_bitmap[]={
, 0x08, 0x20
};
LISP_CURSOR horizscroll_cursor = {
1
, horizscrollcursor_bitmap
static const LISP_CURSOR horizscroll_cursor = {
horizscrollcursor_bitmap
, horizscrollcursor_bitmap
, 1
, 7
, 5
, 0
@@ -111,10 +111,10 @@ static const uint8_t horizthumbcursor_bitmap[]={
, 0xAA, 0xA8
};
LISP_CURSOR horizthumb_cursor = {
1
, horizthumbcursor_bitmap
static const LISP_CURSOR horizthumb_cursor = {
horizthumbcursor_bitmap
, horizthumbcursor_bitmap
, 1
, 6
, 8
, 0
@@ -141,10 +141,10 @@ static const uint8_t scrolldowncursor_bitmap[]={
, 0x01, 0x00
};
LISP_CURSOR scrolldown_cursor = {
1
, scrolldowncursor_bitmap
static const LISP_CURSOR scrolldown_cursor = {
scrolldowncursor_bitmap
, scrolldowncursor_bitmap
, 1
, 7
, 15
, 0
@@ -171,10 +171,10 @@ static const uint8_t scrollleftcursor_bitmap[]={
, 0x00, 0x80
};
LISP_CURSOR scrollleft_cursor = {
1
, scrollleftcursor_bitmap
static const LISP_CURSOR scrollleft_cursor = {
scrollleftcursor_bitmap
, scrollleftcursor_bitmap
, 1
, 8
, 5
, 0
@@ -201,10 +201,10 @@ static const uint8_t scrollrightcursor_bitmap[]={
, 0x01, 0x00
};
LISP_CURSOR scrollright_cursor = {
1
, scrollrightcursor_bitmap
static const LISP_CURSOR scrollright_cursor = {
scrollrightcursor_bitmap
, scrollrightcursor_bitmap
, 1
, 7
, 5
, 0
@@ -231,10 +231,10 @@ static const uint8_t scrollupcursor_bitmap[]={
, 0x03, 0x80
};
LISP_CURSOR scrollup_cursor = {
1
, scrollupcursor_bitmap
static const LISP_CURSOR scrollup_cursor = {
scrollupcursor_bitmap
, scrollupcursor_bitmap
, 1
, 7
, 15
, 0
@@ -261,10 +261,10 @@ static const uint8_t vertscrollcursor_bitmap[]={
, 0x01, 0x00
};
LISP_CURSOR vertscroll_cursor = {
1
, vertscrollcursor_bitmap
static const LISP_CURSOR vertscroll_cursor = {
vertscrollcursor_bitmap
, vertscrollcursor_bitmap
, 1
, 7
, 15
, 0
@@ -291,19 +291,19 @@ static const uint8_t vertthumbcursor_bitmap[]={
,0x00,0x00
};
LISP_CURSOR vertthumb_cursor = {
1
, vertthumbcursor_bitmap
static const LISP_CURSOR vertthumb_cursor = {
vertthumbcursor_bitmap
, vertthumbcursor_bitmap
, 1
, 8
, 8
, 0
};
int check_width = 16;
int check_height = 16;
static unsigned int check_width = 16;
static unsigned int check_height = 16;
static const uint8_t check_bits[] = { 0x88, 0x88,
static uint8_t check_bits[] = { 0x88, 0x88,
0x00, 0x00,
0x22, 0x22,
0x00, 0x00,
@@ -319,7 +319,7 @@ static const uint8_t check_bits[] = { 0x88, 0x88,
0x00, 0x00,
0x22, 0x22,
0x00, 0x00 };
static const uint8_t plain_bits[] = { 0x00, 0x00,
static uint8_t plain_bits[] = { 0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
@@ -336,68 +336,4 @@ static const uint8_t plain_bits[] = { 0x00, 0x00,
0x00, 0x00,
0x00, 0x00 };
int Lisp_icon_width = 88;
int Lisp_icon_height = 58;
const uint8_t Lisp_icon[] =
{
0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08,
0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x3f, 0xe2,
0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x10, 0x20,
0xbf, 0xff, 0xff, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x97, 0xa8,
0x3f, 0xff, 0xff, 0xa0, 0x82, 0x08, 0x20, 0x82, 0x08, 0x30, 0x22,
0x20, 0x00, 0x00, 0x88, 0x20, 0x82, 0x08, 0x20, 0x83, 0xf0, 0x20,
0xa0, 0x00, 0x00, 0x82, 0x08, 0x20, 0x82, 0x08, 0x21, 0x10, 0x28,
0x24, 0x01, 0x00, 0xa0, 0x87, 0xff, 0xff, 0xc2, 0x09, 0x1f, 0xe2,
0x29, 0xb2, 0x00, 0x88, 0x24, 0x00, 0x00, 0x60, 0x83, 0x04, 0x20,
0xa9, 0xb2, 0x50, 0x82, 0x0c, 0x00, 0x00, 0x48, 0x21, 0x06, 0x08,
0x29, 0xb2, 0x00, 0xa0, 0x87, 0xff, 0xff, 0xc2, 0x09, 0xfc, 0x82,
0x24, 0x01, 0x00, 0xbf, 0xff, 0xff, 0xff, 0xe0, 0x82, 0x08, 0x20,
0xa0, 0x00, 0x00, 0xbf, 0xff, 0xe0, 0x08, 0x48, 0x21, 0xfe, 0x08,
0x20, 0x01, 0x20, 0xe0, 0x00, 0x20, 0x0f, 0x42, 0x0a, 0x02, 0x82,
0x20, 0x00, 0x90, 0xe0, 0x00, 0x3f, 0xf8, 0x60, 0x83, 0xfe, 0x20,
0xa5, 0x48, 0x90, 0xbf, 0xff, 0xff, 0xff, 0x48, 0x20, 0x82, 0x08,
0x20, 0x00, 0x90, 0xbf, 0xff, 0xe0, 0x08, 0x42, 0x08, 0x20, 0x82,
0x20, 0x01, 0x20, 0xa0, 0x00, 0x35, 0x4f, 0x7f, 0xff, 0xff, 0xe0,
0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x20, 0x08, 0x5f, 0xff, 0xff, 0xe8,
0x20, 0x00, 0x00, 0xa0, 0x00, 0x35, 0x4f, 0x50, 0x00, 0x00, 0x22,
0x3f, 0xff, 0xff, 0xab, 0x56, 0x20, 0x08, 0x70, 0x07, 0xc0, 0x20,
0x82, 0x00, 0x00, 0x20, 0x00, 0x35, 0x0f, 0xd0, 0x0c, 0x47, 0xa8,
0x22, 0x00, 0x00, 0x2d, 0x5a, 0xa0, 0x08, 0x90, 0x0f, 0xcc, 0xa2,
0x0a, 0x00, 0x00, 0x20, 0x00, 0x34, 0x08, 0x30, 0x10, 0x17, 0xa0,
0x82, 0x00, 0x00, 0x20, 0x00, 0x20, 0x0a, 0x10, 0x17, 0xd0, 0x28,
0x22, 0x00, 0x00, 0x20, 0x00, 0x35, 0x08, 0x90, 0x2c, 0x67, 0xa2,
0x0a, 0x00, 0x00, 0x20, 0x00, 0x20, 0x08, 0x30, 0x37, 0xdc, 0xa0,
0x82, 0x00, 0x00, 0x20, 0x00, 0x35, 0x4a, 0x17, 0xe0, 0x07, 0xa8,
0x22, 0x00, 0x00, 0x20, 0x00, 0x20, 0x08, 0x94, 0x57, 0xc0, 0x22,
0x0a, 0x00, 0x00, 0x20, 0x00, 0x20, 0x08, 0x37, 0xec, 0x40, 0x20,
0x83, 0xff, 0xff, 0xe0, 0x00, 0x20, 0x0a, 0x10, 0x27, 0xc0, 0x28,
0x20, 0x82, 0x08, 0x20, 0x00, 0x20, 0x08, 0x90, 0x10, 0x00, 0x22,
0x08, 0x20, 0x82, 0x20, 0x00, 0x3f, 0xf8, 0x30, 0x1f, 0xc0, 0x20,
0x82, 0x08, 0x20, 0xa0, 0x00, 0x20, 0x82, 0x10, 0x0c, 0x40, 0x28,
0x20, 0x82, 0x08, 0x3f, 0xff, 0xe8, 0x20, 0x90, 0x07, 0xc0, 0x22,
0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x30, 0x00, 0x00, 0x20,
0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x10, 0x00, 0x00, 0x28,
0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x9f, 0xff, 0xff, 0xe2,
0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20,
0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82, 0x08,
0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82,
0x42, 0x13, 0x18, 0xc7, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x99, 0x34, 0xa5, 0x24, 0x29, 0x26, 0x38, 0xc5, 0x04, 0x00, 0x00,
0xa1, 0x14, 0x99, 0x27, 0x35, 0x29, 0x40, 0x26, 0x9c, 0x00, 0x00,
0xa1, 0x13, 0xa4, 0xe4, 0x25, 0x29, 0x30, 0xe4, 0xa4, 0x00, 0x00,
0xa1, 0x10, 0xa4, 0x24, 0x24, 0xc9, 0x09, 0x24, 0xa4, 0x00, 0x00,
0x5a, 0x13, 0x18, 0xc7, 0xa4, 0xc6, 0x70, 0xd4, 0x9c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xc0, 0x50, 0x84, 0x00, 0x00, 0x01, 0xc0, 0x02, 0x10, 0x20,
0x02, 0x12, 0x00, 0x48, 0xcb, 0x32, 0x22, 0x0c, 0x02, 0x38, 0x20,
0x03, 0x92, 0x50, 0x31, 0x2c, 0x49, 0x42, 0x12, 0x02, 0x10, 0xe0,
0x02, 0x12, 0x50, 0x31, 0xe8, 0x48, 0x82, 0x12, 0x02, 0x11, 0x20,
0x02, 0x16, 0x50, 0x49, 0x08, 0x49, 0x42, 0x12, 0x02, 0x15, 0x20,
0x02, 0x0a, 0x50, 0x84, 0xc8, 0x32, 0x21, 0xcc, 0x93, 0xc8, 0xe0,
0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif /* XBITMAPS_H */

View File

@@ -7,5 +7,5 @@ void lisp_Xexit(DspInterface dsp);
void Xevent_before_raid(DspInterface dsp);
void Xevent_after_raid(DspInterface dsp);
void Open_Display(DspInterface dsp);
DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, int width_hint, int height_hint, int depth_hint);
DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, unsigned width_hint, unsigned height_hint, unsigned depth_hint);
#endif

View File

@@ -3,7 +3,6 @@
#include <X11/X.h> /* for Window */
#include <X11/Xlib.h> /* for XButtonEvent */
#include "devif.h" /* for DspInterface */
int bound(int a, int b, int c);
void Set_BitGravity(XButtonEvent *event, DspInterface dsp, Window window, int grav);
void enable_Xkeyboard(DspInterface dsp);
void disable_Xkeyboard(DspInterface dsp);