X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=main%2Fpbx.c;h=0638333a3b351f4894348eff9dad433b2d873fb1;hp=82fe6c44913e5fad46851c41e4358159f67c0903;hb=c81350d6f65e9a11da6b3b15a81d8cfb7a5eb6f5;hpb=ef267cd83817c17c46b2b924e765edebd13bb508 diff --git a/main/pbx.c b/main/pbx.c index 82fe6c4..0638333 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -1127,7 +1127,7 @@ static struct match_char *add_pattern_node(struct ast_context *con, struct match static struct match_char *add_exten_to_pattern_tree(struct ast_context *con, struct ast_exten *e1, int findonly) { - struct match_char *m1=0,*m2=0; + struct match_char *m1 = NULL, *m2 = NULL; int specif; int already; int pattern = 0; @@ -1453,7 +1453,7 @@ static int _extension_match_core(const char *pattern, const char *data, enum ext { mode &= E_MATCH_MASK; /* only consider the relevant bits */ - if ( (mode == E_MATCH) && (pattern[0] == '_') && (strcasecmp(pattern,data)==0) ) /* note: if this test is left out, then _x. will not match _x. !!! */ + if ( (mode == E_MATCH) && (pattern[0] == '_') && (!strcasecmp(pattern,data)) ) /* note: if this test is left out, then _x. will not match _x. !!! */ return 1; if (pattern[0] != '_') { /* not a pattern, try exact or partial match */ @@ -1628,12 +1628,12 @@ struct ast_exten *pbx_find_extension(struct ast_channel *chan, const char *label, const char *callerid, enum ext_match_t action) { int x, res; - struct ast_context *tmp=0; - struct ast_exten *e=0, *eroot=0; - struct ast_include *i = 0; - struct ast_sw *sw = 0; - struct ast_exten pattern = {0}; - struct scoreboard score = {0}; + struct ast_context *tmp = NULL; + struct ast_exten *e = NULL, *eroot = NULL; + struct ast_include *i = NULL; + struct ast_sw *sw = NULL; + struct ast_exten pattern = {NULL, }; + struct scoreboard score = {0, }; pattern.label = label; pattern.priority = priority; @@ -1870,7 +1870,7 @@ struct ast_exten *pbx_find_extension(struct ast_channel *chan, */ static int parse_variable_name(char *var, int *offset, int *length, int *isfunc) { - int parens=0; + int parens = 0; *offset = 0; *length = INT_MAX; @@ -2034,7 +2034,7 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c if (places[i] == &globals) ast_rwlock_rdlock(&globalslock); AST_LIST_TRAVERSE(places[i], variables, entries) { - if (strcasecmp(ast_var_name(variables), var)==0) { + if (!strcasecmp(ast_var_name(variables), var)) { s = ast_var_value(variables); break; } @@ -4568,9 +4568,9 @@ static int show_dialplan_helper(int fd, const char *context, const char *exten, if (includecount >= AST_PBX_MAX_STACK) { ast_log(LOG_NOTICE, "Maximum include depth exceeded!\n"); } else { - int dupe=0; + int dupe = 0; int x; - for (x=0;xtotal_exten; + int res = 0, old_total_exten = dpc->total_exten; if (ast_strlen_zero(exten)) exten = NULL; @@ -5407,7 +5407,7 @@ static void get_timerange(struct ast_timing *i, char *times) /* 2-minutes per bit, since the mask has only 32 bits :( */ /* Star is all times */ if (ast_strlen_zero(times) || !strcmp(times, "*")) { - for (x=0; x<24; x++) + for (x = 0; x < 24; x++) i->minmask[x] = 0x3fffffff; /* 30 bits */ return; } @@ -5452,10 +5452,10 @@ static void get_timerange(struct ast_timing *i, char *times) /* Do the last one */ i->minmask[x/30] |= (1 << (x % 30)); #else - for (cth=0; cth<24; cth++) { + for (cth = 0; cth < 24; cth++) { /* Initialize masks to blank */ i->minmask[cth] = 0; - for (ctm=0; ctm<30; ctm++) { + for (ctm = 0; ctm < 30; ctm++) { if ( /* First hour with more than one hour */ (((cth == s1) && (ctm >= s2)) && @@ -5931,7 +5931,7 @@ int ast_async_goto_by_name(const char *channame, const char *context, const char /*! \brief copy a string skipping whitespace */ static int ext_strncpy(char *dst, const char *src, int len) { - int count=0; + int count = 0; while (*src && (count < len - 1)) { switch (*src) { @@ -6903,7 +6903,7 @@ static int pbx_builtin_hangup(struct ast_channel *chan, void *data) */ static int pbx_builtin_gotoiftime(struct ast_channel *chan, void *data) { - int res=0; + int res = 0; char *s, *ts; struct ast_timing timing; @@ -7527,7 +7527,7 @@ int load_pbx(void) __ast_custom_function_register(&exception_function, NULL); /* Register builtin applications */ - for (x=0; x