Skip to content

Commit 8800009

Browse files
committed
Fixed various C90 compliance issues : variables declared after code instead of at the top of a block, true/false used instead of TRUE/FALSE, C++-style comments
1 parent ff93967 commit 8800009

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

fb/drm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ int get_framebuffer(const char *dri_device, const int connector_num, struct fram
8181
drmModeResPtr res;
8282
drmModeEncoderPtr encoder = 0;
8383
drmModeConnectorPtr connector = 0;
84+
drmModeModeInfoPtr resolution = 0;
85+
struct drm_mode_map_dumb mreq;
8486

8587
/* Open the dri device /dev/dri/cardX */
8688
fd = open(dri_device, O_RDWR);
@@ -126,8 +128,7 @@ int get_framebuffer(const char *dri_device, const int connector_num, struct fram
126128
return FRAMEBUFFER_COULD_NOT_FIND_CONNECTOR;
127129

128130
/* Get the preferred resolution */
129-
drmModeModeInfoPtr resolution = 0;
130-
for (int i = 0; i < connector->count_modes; i++) {
131+
for( i = 0; i < connector->count_modes; i++) {
131132
resolution = &connector->modes[i];
132133
if (resolution->type & DRM_MODE_TYPE_PREFERRED)
133134
break;
@@ -165,8 +166,6 @@ int get_framebuffer(const char *dri_device, const int connector_num, struct fram
165166
/* Get the crtc settings */
166167
fb->crtc = drmModeGetCrtc(fd, encoder->crtc_id);
167168

168-
struct drm_mode_map_dumb mreq;
169-
170169
memset(&mreq, 0, sizeof(mreq));
171170
mreq.handle = fb->dumb_framebuffer.handle;
172171

x11new/pdckbd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ static int _modifier_key( KeySym *key)
390390
static bool check_key( int *c)
391391
{
392392
XEvent report;
393-
bool rval = false;
394-
bool wait_for_more_mouse = false;
393+
bool rval = FALSE;
394+
bool wait_for_more_mouse = FALSE;
395395

396396
#ifndef NO_LEAKS
397397
if( !_xim)
@@ -419,13 +419,13 @@ static bool check_key( int *c)
419419
new_rows = attrib.height / PDC_font_height;
420420
if( new_cols != PDC_cols || new_rows != PDC_rows)
421421
{
422-
bool resize_not_in_queue = true;
422+
bool resize_not_in_queue = TRUE;
423423
int i;
424424

425425
PDC_resize_screen( new_rows, new_cols);
426426
for( i = queue_low; i != queue_high; i = (i + 1) % QUEUE_SIZE)
427427
if( key_queue[i] == KEY_RESIZE)
428-
resize_not_in_queue = false;
428+
resize_not_in_queue = FALSE;
429429
if( resize_not_in_queue)
430430
{
431431
SP->resized = TRUE;

x11new/pdcscrn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int PDC_scr_open(void)
173173
assert( win);
174174
wmDeleteMessage = XInternAtom( dis, "WM_DELETE_WINDOW", True);
175175

176-
//Allocate space for the hints
176+
/* Allocate space for the hints */
177177
xshSize = XAllocSizeHints();
178178
xwmhHints = XAllocWMHints();
179179
xchClass = XAllocClassHint();

x11new/pdcsetsc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ int PDC_set_bold(bool boldon)
7878

7979
void PDC_set_title( const char *title)
8080
{
81-
PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
82-
8381
char *temp_string = strdup( title);
8482

83+
PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
8584
if( xtpWinName.value)
8685
XFree( xtpWinName.value);
8786
XStringListToTextProperty( &temp_string, 1, &xtpWinName);

0 commit comments

Comments
 (0)