summaryrefslogtreecommitdiff
path: root/console-client
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2004-03-07 00:27:08 +0000
committerMarcus Brinkmann <marcus@gnu.org>2004-03-07 00:27:08 +0000
commitf60e8dc9ab2948e2ad70b6a347a0550c0d7a802d (patch)
tree43dda6e1700fa97f15becee31b4497cfb08df947 /console-client
parent8fa843fb18e9a934e746dffaebca66670c603967 (diff)
2004-03-07 Marco Gerards <metgerards@student.han.nl>
* bdf.c (bdf_read): Change the types of has_size, has_fbbx, has_metricset, glyph_has_encoding, glyph_has_bbx, glyph_bwidth, glyph_bheight and glyph_blines to unsigned int. * bell.h (struct bell_ops): Change the type of the argument KEY of the interface `deprecated' to unsigned int. All callers changed. * display.h (struct display_ops): Changed the type of the arguments width and height to unsigned int. All callers changed. * driver.c (driver_fini): Change the type of `i' to unsigned int to silence a gcc warning. (driver_start): Likewise. (driver_remove): Likewise. (ADD_REMOVE_COMPONENT): Likewise. (driver_add): Likewise. * generic-speaker.c (beep_on): Cup pitch at 20000, not 327677. Also silences a gcc warning. * ncursesw.c: Changed all calls to the function `ncurses_refresh' to `refresh_screen'. (current_width): Changed type to unsigned int. (current_height): Likewise. (padx): Likewise. (pady): Likewise. (refresh_screen): Cast LINES and COLS to unsigned int. (input_loop): Change `i' from int to unsigned int to silence a gcc warning. * vga.c (current_width): Changed type to unsigned int to silence a gcc warning. (current_heigh): Likewise. (struct vga_display): Changed the type of the members `width' and `height' to unsigned int to silence a gcc warning. (vga_display_change_font): Disabled the unused code for now.
Diffstat (limited to 'console-client')
-rw-r--r--console-client/ChangeLog33
-rw-r--r--console-client/bdf.c16
-rw-r--r--console-client/bell.h2
-rw-r--r--console-client/display.h3
-rw-r--r--console-client/driver.c10
-rw-r--r--console-client/generic-speaker.c6
-rw-r--r--console-client/ncursesw.c28
-rw-r--r--console-client/vga.c13
8 files changed, 74 insertions, 37 deletions
diff --git a/console-client/ChangeLog b/console-client/ChangeLog
index a3fdd3f6..b4393a9f 100644
--- a/console-client/ChangeLog
+++ b/console-client/ChangeLog
@@ -1,3 +1,36 @@
+2004-03-07 Marco Gerards <metgerards@student.han.nl>
+
+ * bdf.c (bdf_read): Change the types of has_size, has_fbbx,
+ has_metricset, glyph_has_encoding, glyph_has_bbx, glyph_bwidth,
+ glyph_bheight and glyph_blines to unsigned int.
+ * bell.h (struct bell_ops): Change the type of the argument KEY of
+ the interface `deprecated' to unsigned int. All callers changed.
+ * display.h (struct display_ops): Changed the type of the
+ arguments width and height to unsigned int. All callers changed.
+ * driver.c (driver_fini): Change the type of `i' to unsigned int
+ to silence a gcc warning.
+ (driver_start): Likewise.
+ (driver_remove): Likewise.
+ (ADD_REMOVE_COMPONENT): Likewise.
+ (driver_add): Likewise.
+ * generic-speaker.c (beep_on): Cup pitch at 20000, not 327677.
+ Also silences a gcc warning.
+ * ncursesw.c: Changed all calls to the function `ncurses_refresh'
+ to `refresh_screen'.
+ (current_width): Changed type to unsigned int.
+ (current_height): Likewise.
+ (padx): Likewise.
+ (pady): Likewise.
+ (refresh_screen): Cast LINES and COLS to unsigned int.
+ (input_loop): Change `i' from int to unsigned int to silence a gcc
+ warning.
+ * vga.c (current_width): Changed type to unsigned int to silence a
+ gcc warning.
+ (current_heigh): Likewise.
+ (struct vga_display): Changed the type of the members `width' and
+ `height' to unsigned int to silence a gcc warning.
+ (vga_display_change_font): Disabled the unused code for now.
+
2003-08-17 Marcus Brinkmann <marcus@gnu.org>
* vga-dynafont.c: Include <stddef.h>.
diff --git a/console-client/bdf.c b/console-client/bdf.c
index 6c67c409..30501f4a 100644
--- a/console-client/bdf.c
+++ b/console-client/bdf.c
@@ -198,24 +198,24 @@ bdf_read (FILE *filep, bdf_font_t *font, int *linecount)
int glyphs;
/* True if we have seen a SIZE keyword so far. */
- int has_size : 1;
+ unsigned int has_size : 1;
/* True if we have seen a FONTBOUNDINGBOX keyword so far. */
- int has_fbbx : 1;
+ unsigned int has_fbbx : 1;
/* True if we have seen a METRICSSET keyword so far. */
- int has_metricsset : 1;
+ unsigned int has_metricsset : 1;
/* Current glyph. */
struct bdf_glyph *glyph;
/* True if we have seen an ENCODING keyword for the glyph. */
- int glyph_has_encoding : 1;
+ unsigned int glyph_has_encoding : 1;
/* True if we have seen an BBX keyword for the glyph. */
- int glyph_has_bbx : 1;
+ unsigned int glyph_has_bbx : 1;
/* Width of the glyph in bytes. */
- int glyph_bwidth;
+ unsigned int glyph_bwidth;
/* Height of the glyph in pixel. */
- int glyph_bheight;
+ unsigned int glyph_bheight;
/* How many bitmap lines have been parsed already. */
- int glyph_blines;
+ unsigned int glyph_blines;
} parser = { location: START, properties: 0, glyphs: 0,
has_size: 0, has_fbbx: 0 };
diff --git a/console-client/bell.h b/console-client/bell.h
index 3ff40bde..8235cca1 100644
--- a/console-client/bell.h
+++ b/console-client/bell.h
@@ -50,7 +50,7 @@ struct bell_ops
error_t (*beep) (void *handle);
/* Do not use, do not remove. */
- void (*deprecated) (void *handle, int key);
+ void (*deprecated) (void *handle, unsigned int key);
};
#endif /* _BELL_H_ */
diff --git a/console-client/display.h b/console-client/display.h
index 3dc97fde..01ddd733 100644
--- a/console-client/display.h
+++ b/console-client/display.h
@@ -139,7 +139,8 @@ struct display_ops
old screen. If the physical screen already has the right
resolution do nothing. This function is always followed by a
write that covers the whole new screen. */
- error_t (*set_dimension) (void *handle, int width, int height);
+ error_t (*set_dimension) (void *handle, unsigned int width,
+ unsigned int height);
};
#endif /* _DISPLAY_H_ */
diff --git a/console-client/driver.c b/console-client/driver.c
index 74df1907..5c4630a0 100644
--- a/console-client/driver.c
+++ b/console-client/driver.c
@@ -65,7 +65,7 @@ driver_init (void)
error_t
driver_fini (void)
{
- int i;
+ unsigned int i;
mutex_lock (&driver_list_lock);
for (i = 0; i < driver_list_len; i++)
@@ -96,7 +96,7 @@ error_t driver_add (const char *const name, const char *const driver,
char *modname;
void *shobj = NULL;
driver_t drv;
- int i;
+ unsigned int i;
char *dir = driver_path;
int defpath = 0;
@@ -242,7 +242,7 @@ error_t
driver_start (char **name)
{
error_t err = 0;
- int i;
+ unsigned int i;
mutex_lock (&driver_list_lock);
for (i = 0; i < driver_list_len; i++)
@@ -268,7 +268,7 @@ driver_start (char **name)
error_t driver_remove (const char *const name)
{
error_t err;
- int i;
+ unsigned int i;
mutex_lock (&driver_list_lock);
for (i = 0; i < driver_list_len; i++)
@@ -330,7 +330,7 @@ driver_add_##component (component##_ops_t ops, void *handle) \
error_t \
driver_remove_##component (component##_ops_t ops, void *handle) \
{ \
- int i; \
+ unsigned int i; \
\
mutex_lock (&component##_list_lock); \
for (i = 0; i < component##_list_len; i++) \
diff --git a/console-client/generic-speaker.c b/console-client/generic-speaker.c
index 05e64875..5eaf3c5c 100644
--- a/console-client/generic-speaker.c
+++ b/console-client/generic-speaker.c
@@ -342,8 +342,8 @@ beep_on (short pitch)
if (pitch < 20)
pitch = 20;
- else if (pitch > 32767)
- pitch = 32767;
+ else if (pitch > 20000)
+ pitch = 20000;
counter = PIT_FREQUENCY / pitch;
@@ -452,7 +452,7 @@ generic_speaker_beep (void *handle)
#if QUAERENDO_INVENIETIS
static void
-generic_speaker_play_melody (void *handle, int key)
+generic_speaker_play_melody (void *handle, unsigned int key)
{
if (key < 0 || key >= sizeof (tune) / sizeof (tune[0]))
return;
diff --git a/console-client/ncursesw.c b/console-client/ncursesw.c
index e14abd7c..8b559016 100644
--- a/console-client/ncursesw.c
+++ b/console-client/ncursesw.c
@@ -37,15 +37,15 @@
static struct mutex ncurses_lock;
/* The current width and height the ncursesw driver is using. */
-static int current_width;
-static int current_height;
+static unsigned int current_width;
+static unsigned int current_height;
/* The window on which the console is shown. */
static WINDOW *conspad;
/* The upper left corner shown in the pad. */
-static int padx;
-static int pady;
+static unsigned int padx;
+static unsigned int pady;
/* Autoscroll is on or off. Autoscroll makes scrolling dependant on
the cursor position. */
@@ -280,8 +280,10 @@ refresh_screen (void)
if (!current_width && !current_height)
return 0;
return prefresh (conspad, pady, padx, 0, 0,
- (current_height <= LINES ? current_height : LINES) - 1,
- (current_width <= COLS ? current_width : COLS) - 1);
+ (current_height <= (unsigned int) LINES
+ ? current_height : (unsigned int) LINES) - 1,
+ (current_width <= (unsigned int) COLS
+ ? current_width : (unsigned int) COLS) - 1);
}
static any_t
@@ -310,7 +312,7 @@ input_loop (any_t unused)
mutex_lock (&ncurses_lock);
while ((ret = wgetch (conspad)) != ERR)
{
- int i;
+ unsigned int i;
int found;
if (w_escaped)
@@ -360,7 +362,7 @@ input_loop (any_t unused)
if (padx < current_width - COLS)
{
padx++;
- ncurses_refresh ();
+ refresh_screen ();
}
break;
case 'i':
@@ -512,7 +514,7 @@ ncursesw_set_cursor_pos (void *handle, uint32_t col, uint32_t row)
padx += COLS / 2;
if (padx > COLS + current_width)
padx = current_width - COLS;
- ncurses_refresh ();
+ refresh_screen ();
}
/* Autoscroll to the left. */
else if (col < padx)
@@ -520,7 +522,7 @@ ncursesw_set_cursor_pos (void *handle, uint32_t col, uint32_t row)
padx -= COLS / 2;
if (padx < 0)
padx = 0;
- ncurses_refresh ();
+ refresh_screen ();
}
/* Autoscroll down. */
if (row > LINES + pady)
@@ -528,7 +530,7 @@ ncursesw_set_cursor_pos (void *handle, uint32_t col, uint32_t row)
pady += LINES / 2;
if (pady > LINES + current_height)
pady = current_height - LINES;
- ncurses_refresh ();
+ refresh_screen ();
}
/* Autoscroll up. */
else if (row < pady)
@@ -536,7 +538,7 @@ ncursesw_set_cursor_pos (void *handle, uint32_t col, uint32_t row)
pady -= LINES / 2;
if (pady < 0)
pady = 0;
- ncurses_refresh ();
+ refresh_screen ();
}
}
@@ -694,7 +696,7 @@ ncursesw_driver_fini (void *handle, int force)
}
static error_t
-ncursesw_set_dimension (void *handle, int width, int height)
+ncursesw_set_dimension (void *handle, unsigned int width, unsigned int height)
{
mutex_lock (&ncurses_lock);
if (width != current_width || height != current_height)
diff --git a/console-client/vga.c b/console-client/vga.c
index 7f666494..ae32049f 100644
--- a/console-client/vga.c
+++ b/console-client/vga.c
@@ -75,8 +75,8 @@ static struct mutex vga_display_lock;
static struct display_ops vga_display_ops;
/* The current width and height the ncursesw driver is using. */
-static int current_width;
-static int current_height;
+static unsigned int current_width;
+static unsigned int current_height;
/* The cursor state to restore the state to. */
static int cursor_state;
@@ -102,8 +102,8 @@ struct vga_display
/* The color palette. */
dynacolor_t dc;
- int width;
- int height;
+ unsigned int width;
+ unsigned int height;
/* Current attribute. */
int cur_conchar_attr_init;
@@ -441,7 +441,7 @@ vga_display_scroll (void *handle, int delta)
return 0;
}
-
+#if 0
/* Change the font on the console CONSOLE to font. The old font will
not be accessed by the vga console subsystem anymore after this
call completed. */
@@ -452,6 +452,7 @@ vga_display_change_font (void *handle, bdf_font_t font)
dynafont_change_font (disp->df, font);
}
+#endif
static inline char
@@ -667,7 +668,7 @@ vga_display_write (void *handle, conchar_t *str, size_t length,
}
static error_t
-vga_set_dimension (void *handle, int width, int height)
+vga_set_dimension (void *handle, unsigned int width, unsigned int height)
{
if (current_width && current_height)
vga_display_clear (handle, current_width * current_height, 0, 0);