From 5f7101a9e3ce53f056991b5c98e26949a2fc10f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Tue, 24 Mar 2015 09:38:02 +0000 Subject: [PATCH] fix parameters for open --- os/pl-file.c | 12 ++++++------ os/pl-option.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/os/pl-file.c b/os/pl-file.c index fbc7d5396..cc6ea01b7 100644 --- a/os/pl-file.c +++ b/os/pl-file.c @@ -3413,16 +3413,16 @@ openStream(term_t file, term_t mode, term_t options) int reposition = TRUE; atom_t alias = NULL_ATOM; atom_t eof_action = ATOM_eof_code; + int close_on_abort = TRUE; atom_t buffer = ATOM_full; atom_t lock = ATOM_none; int wait = TRUE; atom_t encoding = NULL_ATOM; -#ifdef O_LOCALE - PL_locale *locale = NULL; -#endif - int close_on_abort = TRUE; int bom = -1; int scripting = FALSE; +#ifdef O_LOCALE + PL_locale *locale = NULL; +#endif char how[10]; char *h = how; char *path; @@ -3468,13 +3468,13 @@ openStream(term_t file, term_t mode, term_t options) return NULL; } if ( type == ATOM_binary && enc != ENC_OCTET ) - { bad_encoding("type(binary) implies encoding(octet)", encoding); + { bad_encoding("type(binary) implies encoding(octet)", encoding); return NULL; } switch(enc) /* explicitely specified: do not */ { case ENC_OCTET: /* switch to Unicode. For implicit */ case ENC_ASCII: /* and unicode types we must detect */ - case ENC_ISO_LATIN_1: /* and skip the BOM */ + case ENC_ISO_LATIN_1: /* and skip the BOM */ case ENC_WCHAR: bom = FALSE; break; diff --git a/os/pl-option.c b/os/pl-option.c index db37e265c..d823c5bd4 100644 --- a/os/pl-option.c +++ b/os/pl-option.c @@ -35,7 +35,7 @@ Variable argument list: #define MAXOPTIONS 32 typedef union -{ bool *b; /* boolean value */ +{ int *b; /* boolean value */ long *l; /* long value */ int *i; /* integer value */ uintptr_t *sz; /* size_t value */