Skip to content

Commit

Permalink
remove useless zero-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenhael-le-moine committed Jun 12, 2024
1 parent 1eb4ac5 commit 1d7d996
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 153 deletions.
71 changes: 2 additions & 69 deletions src/ui_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,75 +52,8 @@ static unsigned KEYBOARD_HEIGHT, KEYBOARD_WIDTH, TOP_SKIP, SIDE_SKIP, BOTTOM_SKI
DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISP_FRAME, KEYBOARD_OFFSET_X, KEYBOARD_OFFSET_Y, KBD_UPLINE;

static unsigned int ARGBColors[ NB_COLORS ];

static sdl_surfaces_on_off_struct_t sdl_buttons[ NB_KEYS ] = {
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},

{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
};

static sdl_surfaces_on_off_struct_t sdl_ann_tbl[] = {
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
{.surfaceon = 0, .surfaceoff = 0},
};
static sdl_surfaces_on_off_struct_t sdl_buttons[ NB_KEYS ];
static sdl_surfaces_on_off_struct_t sdl_ann_tbl[ NB_ANNUNCIATORS ];

// State to displayed zoomed last pressed key
static SDL_Surface* showkeylastsurf = 0;
Expand Down
87 changes: 3 additions & 84 deletions src/ui_x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,28 +220,7 @@ static bool mapped;

static x11_keypad_t keypad;

static XColor x11_colors[ NB_COLORS ] = {
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
{0, 0, 0, 0, DoRed | DoGreen | DoBlue, 0},
};
static XColor x11_colors[ NB_COLORS ];

static int CompletionType = -1;

Expand Down Expand Up @@ -276,65 +255,7 @@ static int icon_color_mode;
static char* res_name;
static char* res_class;

static x11_button_t x11_buttons[ NB_KEYS ] = {
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},

{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
{.map = 0, .down = 0, .xwin = 0},
};
static x11_button_t x11_buttons[ NB_KEYS ];

#define MAX_PASTE 128
static int paste[ MAX_PASTE * 3 ];
Expand Down Expand Up @@ -377,9 +298,7 @@ static unsigned char nibbles[ 16 ][ 2 ] = {

static unsigned char nibble_bitmap[ 16 ];

static Pixmap x11_ann_pixmaps[ NB_ANNUNCIATORS ] = {
0, 0, 0, 0, 0, 0,
};
static Pixmap x11_ann_pixmaps[ NB_ANNUNCIATORS ];

static icon_map_t icon_maps_sx[] = {
{.w = hp48_icon_width, .h = hp48_icon_height, .c = BLACK, .bits = hp48_icon_bitmap },
Expand Down

0 comments on commit 1d7d996

Please sign in to comment.