[trivial PATCH 11/22] [extern.h] eliminate build warnings
Signed-off-by: Wang Tinggong <wangtinggong@gmail.com> --- src/modules/rlm_otp/extern.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/rlm_otp/extern.h b/src/modules/rlm_otp/extern.h index 5fad0cb..0f1d6a3 100644 --- a/src/modules/rlm_otp/extern.h +++ b/src/modules/rlm_otp/extern.h @@ -66,8 +66,8 @@ typedef struct otp_option_t { void otp_mppe(REQUEST *, otp_pwe_t, const otp_option_t *, const char *); /* otp_pw_valid.c */ -extern int otp_pw_valid(REQUEST *, int, const char *, const otp_option_t *, - char []); +extern int otp_pw_valid(REQUEST *, int, const unsigned char *, + const otp_option_t *, char []); /* otp_radstate.c */ #define OTP_MAX_RADSTATE_LEN 2 + (OTP_MAX_CHALLENGE_LEN * 2 + 8 + 8 + 32)*2 + 1 @@ -82,9 +82,9 @@ extern void otp_pwe_init(void); extern otp_pwe_t otp_pwe_present(const REQUEST *); /* otp_util.c */ -extern void otp_get_random(char *, size_t); +extern void otp_get_random(unsigned char *, size_t); extern void otp_async_challenge(char [OTP_MAX_CHALLENGE_LEN + 1], int); -extern int otp_a2x(const char *, unsigned char *); +extern int otp_a2x(const unsigned char *, unsigned char *); extern void otp_x2a(const unsigned char *, size_t, char *); extern void _otp_pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *, const char *); -- 1.6.0.6
This applies to patches 11-16. Having these be individual unrelated patches is very annoying. It's very difficult to review because the change in prototype is not in the same change as the change to the functions. So I haven't done a thorough job, but for once I am going to blame the author instead of my own laziness. This just looks like churn to me. You change the types of vars from char to unsigned char, but then cast them back when they are used. In at least 2 cases where I caught it, the change in var type is incorrect and you are just making a trivial change without understanding the effects other than to quiet the compiler on your system. There may be at least one change that was correct, and that would only have been the case if a radius structure member changed its signedness. Because of the difficulty of reviewing the changes I'm not going to try to go back and pick out where I thought that might have been the case. I have in the past been extremely diligent about not having any compiler warnings so I'm surprised that rlm_otp is generating any noise. There must be one member in a radius struct somewhere that changed and that is filtering down. -frank
Frank Cusack wrote:
I have in the past been extremely diligent about not having any compiler warnings so I'm surprised that rlm_otp is generating any noise. There must be one member in a radius struct somewhere that changed and that is filtering down.
Changes v1.x to v2.x re-worked a number of the internal structures. So I'm not surprised that some more warnins crept back in. That being said, v1.x had a *lot* of warnings. v2.x has very, very, few. And unlike ISC DHCP, we won't build by default with -Werror. Different versions of GCC have different opinions about warnings. So what works in the ISC development system results in build failures on my system, for minor compiler warnings. Alan DeKok.
participants (3)
-
Alan DeKok -
Frank Cusack -
Wang Tinggong