[SLOF] [PATCH v2] Caps in not always shift

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Thu Jul 9 16:26:10 AEST 2015


Dinar,

I had posted your first version here

https://lists.ozlabs.org/pipermail/slof/2015-July/000012.html

Thomas Huth <thuth at redhat.com> writes:
>  Hi!
>
> Please CC to slof at lists.ozlabs.org now that we've finally got a SLOF
> mailing list :-) !
>
> On Wed,  8 Jul 2015 18:47:44 +0200
> Dinar valeev <k0da at opensuse.org> wrote:
> ...
>>  /**
>> + * Checks if keypos is a latin key
>> + * @param  keypos
>> + * @return -
>> + */
>> +void check_latin(uint8_t keypos)
>> +	if (keypos > KEYP_LATIN_A || keypos < KEYP_LATIN_Z) {
>> +		return true;
>> +	} else {
>> +		return false;
>> +	}
>> +
>
> That does not look like valid C to me ... "void" return type and
> returning true or false ... and what about the outermost curly braces?
>
> Anyway, you could even write this much more simple without if-statement
> instead:
>
> bool check_latin(uint8_t keypos)
> {
> 	return keypos > KEYP_LATIN_A || keypos < KEYP_LATIN_Z;
> }
>
>  Thomas

Regards
Nikunj



More information about the SLOF mailing list