Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib/libast/cdt/dtlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int dtlistprint(Dt_t* dt, Dtlink_t* here, char* (*objprintf)(void*) )
#endif

/* terminal objects: DT_FIRST|DT_LAST */
void* lfirstlast(Dt_t* dt, int type)
static void* lfirstlast(Dt_t* dt, int type)
{
Dtlink_t *lnk;
Dtdisc_t *disc = dt->disc;
Expand All @@ -72,7 +72,7 @@ void* lfirstlast(Dt_t* dt, int type)
}

/* DT_CLEAR */
void* lclear(Dt_t* dt)
static void* lclear(Dt_t* dt)
{
Dtlink_t *lnk, *next;
Dtdisc_t *disc = dt->disc;
Expand All @@ -93,7 +93,7 @@ void* lclear(Dt_t* dt)
}

/* DT_FLATTEN|DT_EXTRACT|DT_RESTORE */
void* llist(Dt_t* dt, Dtlink_t* lnk, int type)
static void* llist(Dt_t* dt, Dtlink_t* lnk, int type)
{
Dtlist_t *list = (Dtlist_t*)dt->data;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/libast/cdt/dttree.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int dttreeprint(Dt_t* dt, Dtlink_t* here, int lev, char* (*objprintf)(void*) )
#endif

/* terminal object: DT_FIRST|DT_LAST */
void* tfirstlast(Dt_t* dt, int type)
static void* tfirstlast(Dt_t* dt, int type)
{
Dtlink_t *t, *root;
Dtdisc_t *disc = dt->disc;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libast/comp/arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ _ast_getentropy(void *s, size_t len)
ast_close(fd);
return -1;
}
o += r;
o += (size_t)r;
}
ast_close(fd);
return 0;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/libast/comp/assert.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This file is part of the ksh 93u+m package *
* Copyright (c) 2024 Contributors to ksh 93u+m *
* Copyright (c) 2024-2026 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 2.0 *
* *
Expand All @@ -10,12 +10,13 @@
* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) *
* *
* Martijn Dekker <martijn@inlv.org> *
* Johnothan King <johnothanking@protonmail.com> *
* *
***********************************************************************/

#include <ast.h>

void noreturn _ast_assertfail(const char *a, const char *fun, const char *file, int line)
noreturn void _ast_assertfail(const char *a, const char *fun, const char *file, int line)
{
#if _has___func__ || _has___FUNCTION__
sfprintf(sfstderr,"\n*** assertion %s failed in %s(), %s:%d\n", a, fun, file, line);
Expand Down
4 changes: 3 additions & 1 deletion src/lib/libast/comp/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ do case $1 in
esac
shift
done
head='#include "FEATURE/standards"
head='#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#include "FEATURE/standards"
#include "FEATURE/common"'
tail='#include "FEATURE/param"'
generated="/* : : generated by $command from $1 : : */"
Expand Down
4 changes: 2 additions & 2 deletions src/lib/libast/comp/eaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _ast_eaccess(const char* path, int flags)
#elif _lib_euidaccess
return euidaccess(path, flags);
#else
int mode;
mode_t mode;
struct stat st;

static int init;
Expand Down Expand Up @@ -106,7 +106,7 @@ _ast_eaccess(const char* path, int flags)
{
if ((ngroups = getgroups(0, NULL)) <= 0)
ngroups = (int)astconf_long(CONF_NGROUPS_MAX);
if (!(groups = newof(0, gid_t, ngroups + 1, 0)))
if (!(groups = newof(0, gid_t, (size_t)ngroups + 1, 0)))
ngroups = -1;
else
ngroups = getgroups(ngroups, groups);
Expand Down
22 changes: 12 additions & 10 deletions src/lib/libast/comp/fnmatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2023 Contributors to ksh 93u+m *
* Copyright (c) 2020-2026 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 2.0 *
* *
Expand All @@ -14,6 +14,7 @@
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* Martijn Dekker <martijn@inlv.org> *
* Johnothan King <johnothanking@protonmail.com> *
* *
***********************************************************************/
/*
Expand Down Expand Up @@ -44,28 +45,29 @@ static const Map_t map[] =
extern int
fnmatch(const char* pattern, const char* subject, int flags)
{
int reflags = REG_SHELL|REG_LEFT;
regflags_t reflags = REG_SHELL|REG_LEFT;
const Map_t* mp;
regex_t re;
regmatch_t match;
int ret;

for (mp = map; mp < &map[elementsof(map)]; mp++)
if (flags & mp->fnm)
reflags |= mp->reg;
reflags |= (regflags_t)mp->reg;
if (flags & FNM_LEADING_DIR)
{
if (!(reflags = regcomp(&re, pattern, reflags)))
if (!(ret = regcomp(&re, pattern, reflags)))
{
reflags = regexec(&re, subject, 1, &match, 0);
ret = regexec(&re, subject, 1, &match, 0);
regfree(&re);
if (!reflags && (reflags = subject[match.rm_eo]))
reflags = reflags == '/' ? 0 : FNM_NOMATCH;
if (!ret && (ret = subject[match.rm_eo]))
ret = ret == '/' ? 0 : FNM_NOMATCH;
}
}
else if (!(reflags = regcomp(&re, pattern, reflags|REG_RIGHT)))
else if (!(ret = regcomp(&re, pattern, reflags|REG_RIGHT)))
{
reflags = regexec(&re, subject, 0, NULL, 0);
ret = regexec(&re, subject, 0, NULL, 0);
regfree(&re);
}
return reflags;
return ret;
}
5 changes: 3 additions & 2 deletions src/lib/libast/comp/frexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2023 Contributors to ksh 93u+m *
* Copyright (c) 2020-2026 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 2.0 *
* *
Expand All @@ -14,6 +14,7 @@
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* Martijn Dekker <martijn@inlv.org> *
* Johnothan King <johnothanking@protonmail.com> *
* *
***********************************************************************/

Expand Down Expand Up @@ -43,7 +44,7 @@ static double pow2tab[DBL_MAX_EXP + 1];
static int
init(void)
{
int x;
size_t x;
double g;

g = 1;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/libast/comp/frexpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2023 Contributors to ksh 93u+m *
* Copyright (c) 2020-2026 Contributors to ksh 93u+m *
* and is licensed under the *
* Eclipse Public License, Version 2.0 *
* *
Expand All @@ -14,6 +14,7 @@
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* Martijn Dekker <martijn@inlv.org> *
* Johnothan King <johnothanking@protonmail.com> *
* *
***********************************************************************/

Expand Down Expand Up @@ -47,7 +48,7 @@ static long double pow2tab[LDBL_MAX_EXP + 1];
static int
init(void)
{
int x;
size_t x;
long double g;

g = 1;
Expand Down
Loading