diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -310,7 +310,7 @@ static bool inetfile(const char *str, size_t len, struct inet_socket_info *isn); static NODE *in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx); static long get_read_timeout(IOBUF *iop); -static ssize_t read_with_timeout(int fd, char *buf, size_t size); +static ssize_t read_with_timeout(int fd, void *buf, size_t size); static bool read_can_timeout = false; static long read_timeout; @@ -896,7 +896,8 @@ redirect_string(const char *str, size_t explen, bool not_string, if (strlen(rp->value) == explen && memcmp(rp->value, str, explen) == 0) { if (do_lint) { - check_duplicated_redirections(rp->value, explen, rp->flag, tflag); + check_duplicated_redirections(rp->value, explen, + (redirect_flags_t) rp->flag, (redirect_flags_t) tflag); } if (((rp->flag & ~(RED_NOBUF|RED_EOF|RED_PTY)) == tflag @@ -920,7 +921,7 @@ redirect_string(const char *str, size_t explen, bool not_string, newstr[explen] = '\0'; str = newstr; rp->value = newstr; - rp->flag = tflag; + rp->flag = (redirect_flags_t) tflag; init_output_wrapper(& rp->output); rp->output.name = str; rp->iop = NULL; @@ -2957,8 +2958,8 @@ do_getline(int into_variable, IOBUF *iop) typedef struct { const char *envname; - char **dfltp; /* pointer to address of default path */ - char **awkpath; /* array containing library search paths */ + const char **dfltp; /* pointer to address of default path */ + const char **awkpath; /* array containing library search paths */ int max_pathlen; /* length of the longest item in awkpath */ } path_info; @@ -2977,8 +2978,9 @@ static path_info pi_awklibpath = { static void init_awkpath(path_info *pi) { - char *path; - char *start, *end, *p; + const char *path; + const char *start, *end; + char *p; int len, i; int max_path; /* (# of allocated paths)-1 */ @@ -2987,12 +2989,12 @@ init_awkpath(path_info *pi) path = pi->dfltp[0]; /* count number of separators */ - for (max_path = 0, p = path; *p; p++) + for (max_path = 0, p = (char *) path; *p; p++) if (*p == envsep) max_path++; // +3 --> 2 for null entries at front and end of path, 1 for NULL end of list - ezalloc(pi->awkpath, char **, (max_path + 3) * sizeof(char *), "init_awkpath"); + ezalloc(pi->awkpath, const char **, (max_path + 3) * sizeof(char *), "init_awkpath"); start = path; i = 0; @@ -4399,7 +4401,7 @@ get_read_timeout(IOBUF *iop) */ static ssize_t -read_with_timeout(int fd, char *buf, size_t size) +read_with_timeout(int fd, void *buf, size_t size) { #if ! defined(VMS) fd_set readfds; |