diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-16 15:54:42 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-16 15:54:42 -0400 |
commit | b4a429729774f91ff259fe17d256b00134bc9f1f (patch) | |
tree | 6d3bb2a7e52e1e7bbd4b966c259ef9ee00d52d64 | |
parent | 2d7d559d9536551dd21e116fe9c3806b8d72f690 (diff) |
astyle fixes
-rw-r--r-- | device-functions.c | 39 | ||||
-rw-r--r-- | gpib.c | 2 | ||||
-rw-r--r-- | instr-daemon.c | 8 | ||||
-rw-r--r-- | menus.c | 4 |
4 files changed, 29 insertions, 24 deletions
diff --git a/device-functions.c b/device-functions.c index a9fc638..8e59686 100644 --- a/device-functions.c +++ b/device-functions.c @@ -4546,9 +4546,9 @@ void Main_update_shift_registers() // reset update sensors globals.Changes.update_os = 0; - globals.Changes.update_amp = 0; - globals.Changes.update_zout = 0; - globals.Changes.update_load = 0; + globals.Changes.update_amp = 0; + globals.Changes.update_zout = 0; + globals.Changes.update_load = 0; } @@ -4577,7 +4577,8 @@ int IO_Setup_RS232(int baud, char hardhand, gboolean update_flash) // this is a conversation handler for pam, it basically sends the password when pam asks for it -static int conversation(int num_msg, const struct pam_message **msgs, struct pam_response **resp, void *appdata_ptr) { +static int conversation(int num_msg, const struct pam_message **msgs, struct pam_response **resp, void *appdata_ptr) +{ struct pam_response* responses = calloc(num_msg, sizeof(struct pam_response)); if (!responses) { @@ -4589,14 +4590,15 @@ static int conversation(int num_msg, const struct pam_message **msgs, struct pam const struct pam_message *msg = msgs[i]; struct pam_response* response = &(responses[i]); switch (msg->msg_style) { - case PAM_PROMPT_ECHO_OFF: - response->resp = strdup((char*) appdata_ptr); - if (!response->resp) - return PAM_CONV_ERR; - break; - - default: + case PAM_PROMPT_ECHO_OFF: + response->resp = strdup((char*) appdata_ptr); + if (!response->resp) { return PAM_CONV_ERR; + } + break; + + default: + return PAM_CONV_ERR; } response->resp_retcode = 0; } @@ -4606,15 +4608,18 @@ static int conversation(int num_msg, const struct pam_message **msgs, struct pam return PAM_SUCCESS; } -static gboolean checkpassword(const char* username, char* password) { +static gboolean checkpassword(const char* username, char* password) +{ struct pam_conv pam_conversation = { conversation, password }; pam_handle_t* pamh; - if (pam_start("passwd", username, &pam_conversation, &pamh) != PAM_SUCCESS) + if (pam_start("passwd", username, &pam_conversation, &pamh) != PAM_SUCCESS) { return FALSE; + } - if (pam_authenticate(pamh, 0) != PAM_SUCCESS) + if (pam_authenticate(pamh, 0) != PAM_SUCCESS) { return FALSE; + } // we only want to check the password and not actually start a session, so get out of here @@ -4623,7 +4628,8 @@ static gboolean checkpassword(const char* username, char* password) { return TRUE; } -int change_password(gchar *old_password, gchar *new_password) { +int change_password(gchar *old_password, gchar *new_password) +{ gboolean old_valid = TRUE; @@ -4659,8 +4665,7 @@ int change_password(gchar *old_password, gchar *new_password) { lu_end(ctx); return OK; - } - else { + } else { return password_change_error; } } @@ -783,7 +783,7 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string) if (GPIB_response_already_pending()) { /* if MAV already, data will be lost. Set QYE bit in STB. */ queue_error_for_gpib_only(query_error_interrupted); } - + // needs to be freed gchar *term_string = g_strdup_printf ("%s\n", in_string); diff --git a/instr-daemon.c b/instr-daemon.c index 4d65a54..b64a94e 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -246,9 +246,9 @@ int main(int argc, char **argv) if (on_delay < MIN_STARTUP_DELAY) { on_delay = MIN_STARTUP_DELAY; } - if (on_delay > MAX_STARTUP_DELAY) { - on_delay = MAX_STARTUP_DELAY; - } + if (on_delay > MAX_STARTUP_DELAY) { + on_delay = MAX_STARTUP_DELAY; + } while ((timer_count=sec_timer()-globals.Timers.startup_timer_value) < on_delay) { message = g_strdup_printf ("%ld ", on_delay - timer_count); @@ -352,7 +352,7 @@ static gboolean periodic_poll (void) Menu_Check_Buttons (); - int i; + int i; for (i=0; i<max_channels; i++) { if (globals.Flash.monitor_enabled[i]) { I2C_Check_Monitors(); @@ -250,8 +250,8 @@ static int Menu_Is_Item_Visible(int LCD_entry) void Update_Main_Menu_If_Visible(void) { if ( (globals.MenuStatus.Type_Of_Menu == Main_Menu_On) && - (globals.MenuStatus.Error_Screen == NO) && - (globals.MenuStatus.Nonstd_Display == NO)) { + (globals.MenuStatus.Error_Screen == NO) && + (globals.MenuStatus.Nonstd_Display == NO)) { Show_Main_Menu(); } } |