static void opts_setdefault(void) {
memset(&opts, 0, sizeof(opts_cmd_t));
OPTS_OPTION_BOOL(OPTION_CORRECTION) = true;
- OPTS_OPTION_STR(OPTION_PROGSRC) = "progs.src";
+ OPTS_OPTION_STR(OPTION_PROGSRC) = "progs.src";
/* warnings */
opts_set(opts.warn, WARN_UNUSED_VARIABLE, true);
opts_set(opts.warn, WARN_PARENTHESIS, true);
opts_set(opts.warn, WARN_CONST_OVERWRITE, true);
opts_set(opts.warn, WARN_DIRECTIVE_INMACRO, true);
+ opts_set(opts.warn, WARN_BUILTINS, true);
/* flags */
opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true);
void opts_init(const char *output, int standard, size_t arraysize) {
opts_setdefault();
- OPTS_OPTION_STR(OPTION_OUTPUT) = (char*)output;
+ OPTS_OPTION_STR(OPTION_OUTPUT) = output;
OPTS_OPTION_U32(OPTION_STANDARD) = standard;
OPTS_OPTION_U32(OPTION_MAX_ARRAY_SIZE) = arraysize;
OPTS_OPTION_U16(OPTION_MEMDUMPCOLS) = 16;
}
static size_t opts_ini_parse (
- FILE *filehandle,
+ fs_file_t *filehandle,
char *(*loadhandle)(const char *, const char *, const char *),
char **errorhandle
) {
char *read_name;
char *read_value;
- while (fs_file_getline(&line, &linesize, filehandle) != EOF) {
+ while (fs_file_getline(&line, &linesize, filehandle) != FS_FILE_EOF) {
parse_beg = line;
/* handle BOM */
/* section found */
if (*(parse_end = opts_ini_next(parse_beg + 1, ']')) == ']') {
* parse_end = '\0'; /* terminate bro */
- platform_strncpy(section_data, parse_beg + 1, sizeof(section_data));
+ util_strncpy(section_data, parse_beg + 1, sizeof(section_data));
section_data[sizeof(section_data) - 1] = '\0';
*oldname_data = '\0';
} else if (!error) {
opts_ini_rstrip(read_value);
/* valid name value pair, lets call down to handler */
- platform_strncpy(oldname_data, read_name, sizeof(oldname_data));
+ util_strncpy(oldname_data, read_name, sizeof(oldname_data));
oldname_data[sizeof(oldname_data) - 1] ='\0';
if ((*errorhandle = loadhandle(section_data, read_name, read_value)) && !error)
*/
char *error = NULL;
size_t line;
- FILE *ini;
+ fs_file_t *ini;
if (!file) {
/* try ini */