Merge "AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro."
authorJoshua Colp <jcolp@digium.com>
Thu, 14 May 2015 10:03:43 +0000 (05:03 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Thu, 14 May 2015 10:03:43 +0000 (05:03 -0500)
1  2 
addons/res_config_mysql.c
apps/app_voicemail.c
res/res_fax_spandsp.c
res/res_rtp_asterisk.c

@@@ -1202,44 -1202,38 +1202,44 @@@ static int require_mysql(const char *da
                                                        PICK_WHICH_ALTER_ACTION(bigint)
                                                }
                                        }
 -                              } else if (strncmp(column->type, "float", 5) == 0 && !ast_rq_is_int(type) && type != RQ_FLOAT) {
 -                                      if (table->database->requirements == RQ_WARN) {
 -                                              ast_log(LOG_WARNING, "Realtime table %s@%s: Column %s cannot be a %s\n", tablename, database, column->name, column->type);
 -                                              res = -1;
 -                                      } else if (table->database->requirements == RQ_CREATECLOSE && modify_mysql(database, tablename, column, type, size) == 0) {
 -                                              table_altered = 1;
 -                                      } else if (table->database->requirements == RQ_CREATECHAR && modify_mysql(database, tablename, column, RQ_CHAR, size) == 0) {
 -                                              table_altered = 1;
 -                                      } else {
 -                                              res = -1;
 +                              } else if (strncmp(column->type, "float", 5) == 0) {
 +                                      if (!ast_rq_is_int(type) && type != RQ_FLOAT) {
 +                                              if (table->database->requirements == RQ_WARN) {
 +                                                      ast_log(LOG_WARNING, "Realtime table %s@%s: Column %s cannot be a %s\n", tablename, database, column->name, column->type);
 +                                                      res = -1;
 +                                              } else if (table->database->requirements == RQ_CREATECLOSE && modify_mysql(database, tablename, column, type, size) == 0) {
 +                                                      table_altered = 1;
 +                                              } else if (table->database->requirements == RQ_CREATECHAR && modify_mysql(database, tablename, column, RQ_CHAR, size) == 0) {
 +                                                      table_altered = 1;
 +                                              } else {
 +                                                      res = -1;
 +                                              }
                                        }
 -                              } else if ((strncmp(column->type, "datetime", 8) == 0 || strncmp(column->type, "timestamp", 9) == 0) && type != RQ_DATETIME) {
 -                                      if (table->database->requirements == RQ_WARN) {
 -                                              ast_log(LOG_WARNING, "Realtime table %s@%s: Column %s cannot be a %s\n", tablename, database, column->name, column->type);
 -                                              res = -1;
 -                                      } else if (table->database->requirements == RQ_CREATECLOSE && modify_mysql(database, tablename, column, type, size) == 0) {
 -                                              table_altered = 1;
 -                                      } else if (table->database->requirements == RQ_CREATECHAR && modify_mysql(database, tablename, column, RQ_CHAR, size) == 0) {
 -                                              table_altered = 1;
 -                                      } else {
 -                                              res = -1;
 +                              } else if (strncmp(column->type, "datetime", 8) == 0 || strncmp(column->type, "timestamp", 9) == 0) {
 +                                      if (type != RQ_DATETIME) {
 +                                              if (table->database->requirements == RQ_WARN) {
 +                                                      ast_log(LOG_WARNING, "Realtime table %s@%s: Column %s cannot be a %s\n", tablename, database, column->name, column->type);
 +                                                      res = -1;
 +                                              } else if (table->database->requirements == RQ_CREATECLOSE && modify_mysql(database, tablename, column, type, size) == 0) {
 +                                                      table_altered = 1;
 +                                              } else if (table->database->requirements == RQ_CREATECHAR && modify_mysql(database, tablename, column, RQ_CHAR, size) == 0) {
 +                                                      table_altered = 1;
 +                                              } else {
 +                                                      res = -1;
 +                                              }
                                        }
 -                              } else if ((strncmp(column->type, "date", 4) == 0) && type != RQ_DATE) {
 -                                      if (table->database->requirements == RQ_WARN) {
 -                                              ast_log(LOG_WARNING, "Realtime table %s@%s: Column %s cannot be a %s\n", tablename, database, column->name, column->type);
 -                                              res = -1;
 -                                      } else if (table->database->requirements == RQ_CREATECLOSE && modify_mysql(database, tablename, column, type, size) == 0) {
 -                                              table_altered = 1;
 -                                      } else if (table->database->requirements == RQ_CREATECHAR && modify_mysql(database, tablename, column, RQ_CHAR, size) == 0) {
 -                                              table_altered = 1;
 -                                      } else {
 -                                              res = -1;
 +                              } else if (strncmp(column->type, "date", 4) == 0) {
 +                                      if (type != RQ_DATE) {
 +                                              if (table->database->requirements == RQ_WARN) {
 +                                                      ast_log(LOG_WARNING, "Realtime table %s@%s: Column %s cannot be a %s\n", tablename, database, column->name, column->type);
 +                                                      res = -1;
 +                                              } else if (table->database->requirements == RQ_CREATECLOSE && modify_mysql(database, tablename, column, type, size) == 0) {
 +                                                      table_altered = 1;
 +                                              } else if (table->database->requirements == RQ_CREATECHAR && modify_mysql(database, tablename, column, RQ_CHAR, size) == 0) {
 +                                                      table_altered = 1;
 +                                              } else {
 +                                                      res = -1;
 +                                              }
                                        }
                                } else { /* Other, possibly unsupported types? */
                                        if (table->database->requirements == RQ_WARN) {
@@@ -1754,10 -1748,10 +1754,10 @@@ static char *handle_cli_realtime_mysql_
  }
  
  AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "MySQL RealTime Configuration Driver",
-               .support_level = AST_MODULE_SUPPORT_EXTENDED,
-               .load = load_module,
-               .unload = unload_module,
-               .reload = reload,
-               .load_pri = AST_MODPRI_REALTIME_DRIVER,
-               );
+       .support_level = AST_MODULE_SUPPORT_EXTENDED,
+       .load = load_module,
+       .unload = unload_module,
+       .reload = reload,
+       .load_pri = AST_MODPRI_REALTIME_DRIVER,
+ );
  
diff --combined apps/app_voicemail.c
@@@ -617,7 -617,6 +617,7 @@@ static AST_LIST_HEAD_STATIC(vmstates, v
  #define VM_MESSAGEWRAP   (1 << 17)  /*!< Wrap around from the last message to the first, and vice-versa */
  #define VM_FWDURGAUTO    (1 << 18)  /*!< Autoset of Urgent flag on forwarded Urgent messages set globally */
  #define ERROR_LOCK_PATH  -100
 +#define ERROR_MAX_MSGS   -101
  #define OPERATOR_EXIT     300
  
  enum vm_box {
@@@ -7094,7 -7093,7 +7094,7 @@@ static int save_to_folder(struct ast_vm
        } else {
                if (x >= vmu->maxmsg) {
                        ast_unlock_path(ddir);
 -                      return -1;
 +                      return ERROR_MAX_MSGS;
                }
        }
        make_file(sfn, sizeof(sfn), dir, msg);
@@@ -8919,7 -8918,7 +8919,7 @@@ static int close_mailbox(struct vm_stat
                } else if ((!strcasecmp(vms->curbox, "INBOX") || !strcasecmp(vms->curbox, "Urgent")) && vms->heard[x] && ast_test_flag(vmu, VM_MOVEHEARD) && !vms->deleted[x]) {
                        /* Move to old folder before deleting */
                        res = save_to_folder(vmu, vms, x, 1, NULL, 0);
 -                      if (res == ERROR_LOCK_PATH) {
 +                      if (res == ERROR_LOCK_PATH || res == ERROR_MAX_MSGS) {
                                /* If save failed do not delete the message */
                                ast_log(AST_LOG_WARNING, "Save failed.  Not moving message: %s.\n", res == ERROR_LOCK_PATH ? "unable to lock path" : "destination folder full");
                                vms->deleted[x] = 0;
@@@ -16117,9 -16116,9 +16117,9 @@@ play2_msg_cleanup
   */
  
  AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
-               .support_level = AST_MODULE_SUPPORT_CORE,
-               .load = load_module,
-               .unload = unload_module,
-               .reload = reload,
-               .nonoptreq = "res_adsi,res_smdi",
-               );
+       .support_level = AST_MODULE_SUPPORT_CORE,
+       .load = load_module,
+       .unload = unload_module,
+       .reload = reload,
+       .nonoptreq = "res_adsi,res_smdi",
+ );
diff --combined res/res_fax_spandsp.c
        <support_level>extended</support_level>
  ***/
  
 -#include "asterisk.h"
 -
 -ASTERISK_REGISTER_FILE()
 -
 +/* Include spandsp headers before asterisk.h so the inline functions can continue using
 + * malloc and free, even with MALLOC_DEBUG enabled. */
  #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES
  #include <spandsp.h>
  #include <spandsp/version.h>
  
 +#include "asterisk.h"
 +
 +ASTERISK_REGISTER_FILE()
 +
  #include "asterisk/logger.h"
  #include "asterisk/module.h"
  #include "asterisk/strings.h"
@@@ -1265,7 -1263,7 +1265,7 @@@ static int load_module(void
  
  
  AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Spandsp G.711 and T.38 FAX Technologies",
-               .support_level = AST_MODULE_SUPPORT_EXTENDED,
-               .load = load_module,
-               .unload = unload_module,
-              );
+       .support_level = AST_MODULE_SUPPORT_EXTENDED,
+       .load = load_module,
+       .unload = unload_module,
+ );
diff --combined res/res_rtp_asterisk.c
@@@ -2016,9 -2016,8 +2016,9 @@@ static int __rtp_recvfrom(struct ast_rt
  #ifdef HAVE_OPENSSL_SRTP
        dtls_srtp_check_pending(instance, rtp, rtcp);
  
 -      /* If this is an SSL packet pass it to OpenSSL for processing */
 -      if ((*in >= 20) && (*in <= 64)) {
 +      /* If this is an SSL packet pass it to OpenSSL for processing. RFC section for first byte value:
 +       * https://tools.ietf.org/html/rfc5764#section-5.1.2 */
 +      if ((*in >= 20) && (*in <= 63)) {
                struct dtls_details *dtls = !rtcp ? &rtp->dtls : &rtp->rtcp->dtls;
                int res = 0;
  
@@@ -5368,9 -5367,9 +5368,9 @@@ static int unload_module(void
  }
  
  AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Asterisk RTP Stack",
-               .support_level = AST_MODULE_SUPPORT_CORE,
-               .load = load_module,
-               .unload = unload_module,
-               .reload = reload_module,
-               .load_pri = AST_MODPRI_CHANNEL_DEPEND,
-               );
+       .support_level = AST_MODULE_SUPPORT_CORE,
+       .load = load_module,
+       .unload = unload_module,
+       .reload = reload_module,
+       .load_pri = AST_MODPRI_CHANNEL_DEPEND,
+ );