Bug 110827 - bad source code
bad source code
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gok (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Blandford
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-24 12:14 EST by d.binderman
Modified: 2013-04-02 00:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-29 14:05:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2003-11-24 12:14:54 EST
Description of problem:
I just tried to compile package gok-0_7_1-4 from Fedora.

The compiler said

1.

gok-page-actions.c(117): remark #592: variable "bReturnCode" is used 
before its
value is set

The source code is

        gboolean bReturnCode;

		/* more code here */

		return bReturnCode;

This is in need of repair.

2.

gok-keyslotter.c(86): warning #187: use of "=" where "==" may have 
been intendedgok-keyslotter.c(87): warning #187: use of "=" 
where "==" may have been intended

The source code is 

                                if (((keytype = KEYTYPE_WORDCOMPLETE) 
&& (gok_keyboard_get_wordcomplete_keys_added (pKeyboard) == TRUE)) ||
                                    ((keytype = 
KEYTYPE_COMMANDPREDICT) && 
(gok_keyboard_get_commandpredict_keys_added (pKeyboard) == TRUE)) )

Better source code might be

	if (((keytype == KEYTYPE_WORDCOMPLETE) 
		&& (gok_keyboard_get_wordcomplete_keys_added 
(pKeyboard) == TRUE)) 
	|| ((keytype == KEYTYPE_COMMANDPREDICT) 
		&& (gok_keyboard_get_commandpredict_keys_added 
(pKeyboard) == TRUE)) )

Note changing = for ==.

3.

gok-keyslotter.c(150): warning #187: use of "=" where "==" may have 
been intended
gok-keyslotter.c(151): warning #187: use of "=" where "==" may have 
been intended

The source code is

                if ( ((keytype = KEYTYPE_WORDCOMPLETE) &&( 
gok_keyboard_get_supports_wordcomplete (pKeyboard) == TRUE)) ||
                     ((keytype = KEYTYPE_COMMANDPREDICT) &&( 
gok_keyboard_get_supports_commandprediction (pKeyboard) == TRUE) ))

Better might be

	if ( ((keytype == KEYTYPE_WORDCOMPLETE) 
		&&( gok_keyboard_get_supports_wordcomplete 
(pKeyboard) == TRUE)) 
	|| ((keytype == KEYTYPE_COMMANDPREDICT) 
		&&( gok_keyboard_get_supports_commandprediction 
(pKeyboard) == TRUE) ))

Note changing = for ==.


Version-Release number of selected component (if applicable):
gok-0_7_1-4 

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 David Bolter 2004-03-29 12:16:14 EST
I've just applied your suggestions to gok in cvs.  Please close at will.

Note You need to log in before you can comment on or make changes to this bug.