"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libponyrt/options/options.c" between
ponyc-0.33.1.tar.gz and ponyc-0.33.2.tar.gz

About: Pony is an object-oriented, actor-model, capabilities-secure, high performance programming language.

options.c  (ponyc-0.33.1):options.c  (ponyc-0.33.2)
#include "options.h" #include "options.h"
#include "ponyassert.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#define MATCH_LONG 1 #define MATCH_LONG 1
#define MATCH_SHORT 2 #define MATCH_SHORT 2
#define MATCH_NONE 3 #define MATCH_NONE 3
#define PARSE_ARG (OPT_ARG_REQUIRED | OPT_ARG_OPTIONAL) #define PARSE_ARG (OPT_ARG_REQUIRED | OPT_ARG_OPTIONAL)
static bool end_reached(const opt_arg_t* arg) static bool end_reached(const opt_arg_t* arg)
skipping to change at line 106 skipping to change at line 107
s->idx++; s->idx++;
} }
} }
static void strip_accepted_opts(opt_state_t* s) static void strip_accepted_opts(opt_state_t* s)
{ {
if(s->remove > 0) if(s->remove > 0)
{ {
*s->argc -= s->remove; *s->argc -= s->remove;
pony_assert(*s->argc >= s->idx);
memmove(&s->argv[s->idx], &s->argv[s->idx + s->remove], memmove(&s->argv[s->idx], &s->argv[s->idx + s->remove],
(*s->argc - s->idx) * sizeof(char*)); (unsigned int)(*s->argc - s->idx) * sizeof(char*));
s->idx--; s->idx--;
s->remove = 0; s->remove = 0;
} }
} }
static void parse_long_opt_arg(opt_state_t* s) static void parse_long_opt_arg(opt_state_t* s)
{ {
if(*s->opt_end == '=') if(*s->opt_end == '=')
skipping to change at line 248 skipping to change at line 250
{ {
parse_short_opt_arg(s); parse_short_opt_arg(s);
if(s->arg_val == NULL && (m->flag & OPT_ARG_REQUIRED)) if(s->arg_val == NULL && (m->flag & OPT_ARG_REQUIRED))
return missing_argument(s); return missing_argument(s);
} }
} }
strip_accepted_opts(s); strip_accepted_opts(s);
return m->id; return (int)m->id;
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)