duosecurity/duo_unix — pull request #32 by brooksdavis (2013-06-20 16:39:46+00:00)
Title: fix warnings found by clang

This fixes two sets of warnings produced by clang 3.3. The bson.c fix silences a harmless warning:

bson.c:42:13: warning: unused function 'bson_swap_endian64' [-Wunused-function]
static void bson_swap_endian64(void* outp, const void* inp){
^
1 warning generated.

The fixes to duo.[ch] fix a warning where the compiler will cause authentication to always fail:

duo.c:429:48: warning: comparison of constant -1 with expression of type
'duo_code_t' is always true [-Wtautological-constant-out-of-range-compare]
if ((ret = _duo_preauth(ctx, &obj, username)) != -1) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
duo.c:434:66: warning: comparison of constant -1 with expression of type
'duo_code_t' is always true [-Wtautological-constant-out-of-range-compare]
if ((ret = _duo_prompt(ctx, &obj, flags, buf, sizeof(buf), &p)) != -1) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
2 warnings generated.