fixed some type mismatch warnings

This commit is contained in:
hyung-hwan 2022-04-08 07:19:48 +00:00
parent b3e282e0d4
commit 324274bc16
9 changed files with 12 additions and 25 deletions

View File

@ -170,7 +170,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \
$(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \ $(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \
$(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \ $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \
$(top_srcdir)/ac/tap-driver.sh $(top_srcdir)/pkgs/hawk.spec.in \ $(top_srcdir)/ac/tap-driver.sh $(top_srcdir)/pkgs/hawk.spec.in \
ac/ar-lib ac/compile ac/config.guess ac/config.sub \ ac/ar-lib ac/compile ac/config.guess ac/config.sub ac/depcomp \
ac/install-sh ac/ltmain.sh ac/missing ac/install-sh ac/ltmain.sh ac/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION) distdir = $(PACKAGE)-$(VERSION)

View File

@ -866,7 +866,7 @@ int hawk_fio_init (hawk_fio_t* fio, hawk_gem_t* gem, const hawk_ooch_t* path, in
#if defined(HAWK_OOCH_IS_BCH) #if defined(HAWK_OOCH_IS_BCH)
/* nothing to do */ /* nothing to do */
#else #else
if (path_mb != path_mb_buf && path_mb != path) if (path_mb != path_mb_buf && path_mb != (hawk_bch_t*)path)
{ {
hawk_gem_freemem (fio->gem, path_mb); hawk_gem_freemem (fio->gem, path_mb);
} }

View File

@ -1695,13 +1695,6 @@ HAWK_EXPORT void hawk_seterruvfmt (
# define hawk_seterrvfmt hawk_seterrbvfmt # define hawk_seterrvfmt hawk_seterrbvfmt
#endif #endif
HAWK_EXPORT void hawk_seterror (
hawk_t* hawk,
const hawk_loc_t* errloc,
hawk_errnum_t errnum,
const hawk_oocs_t* errarg
);
/** /**
* The hawk_getopt() function gets the value of an option * The hawk_getopt() function gets the value of an option
* specified by \a id into the buffer pointed to by \a value. * specified by \a id into the buffer pointed to by \a value.

View File

@ -44,7 +44,7 @@ extern "C" {
#endif #endif
hawk_rio_type_t hawk_rtx_intoriotype (hawk_rtx_t* rtx, hawk_in_type_t in_type); hawk_rio_type_t hawk_rtx_intoriotype (hawk_rtx_t* rtx, hawk_in_type_t in_type);
hawk_rio_type_t hawk_rtx_outtoriotype (hawk_rtx_t* rtx, hawk_in_type_t out_type); hawk_rio_type_t hawk_rtx_outtoriotype (hawk_rtx_t* rtx, hawk_out_type_t out_type);
int hawk_rtx_readio ( int hawk_rtx_readio (
hawk_rtx_t* rtx, hawk_in_type_t in_type, hawk_rtx_t* rtx, hawk_in_type_t in_type,

View File

@ -98,7 +98,7 @@ hawk_rio_type_t hawk_rtx_intoriotype (hawk_rtx_t* rtx, hawk_in_type_t in_type)
return in_type_map[in_type]; return in_type_map[in_type];
} }
hawk_rio_type_t hawk_rtx_outtoriotype (hawk_rtx_t* rtx, hawk_in_type_t out_type) hawk_rio_type_t hawk_rtx_outtoriotype (hawk_rtx_t* rtx, hawk_out_type_t out_type)
{ {
return out_type_map[out_type]; return out_type_map[out_type];
} }

View File

@ -9801,11 +9801,15 @@ wp_mod_main:
if ((fmt[i] != 's' && !HAWK_BYTE_PRINTABLE(curc)) || fmt[i] == 'w' || fmt[i] == 'W') if ((fmt[i] != 's' && !HAWK_BYTE_PRINTABLE(curc)) || fmt[i] == 'w' || fmt[i] == 'W')
{ {
hawk_bch_t xbuf[3]; hawk_bch_t xbuf[3];
#if 0 /* the range check isn't needed for hawk_bch_t. it's always <= 0xFF */
if (curc <= 0xFF) if (curc <= 0xFF)
{ {
#endif
if (hawk_becs_ncat(out, HAWK_BT("\\x"), 2) == (hawk_oow_t)-1) goto s_fail; if (hawk_becs_ncat(out, HAWK_BT("\\x"), 2) == (hawk_oow_t)-1) goto s_fail;
hawk_byte_to_bcstr(curc, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); hawk_byte_to_bcstr(curc, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0'));
if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail;
#if 0
} }
else if (curc <= 0xFFFF) else if (curc <= 0xFFFF)
{ {
@ -9829,6 +9833,7 @@ wp_mod_main:
hawk_byte_to_bcstr(u32 & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); hawk_byte_to_bcstr(u32 & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0'));
if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail;
} }
#endif
} }
else else
{ {

View File

@ -93,7 +93,7 @@ static int fnc_file_to_file (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
/* result = sed::file_to_file ("s/ABC/123/g", input_file, output_file [, option_string]) */ /* result = sed::file_to_file ("s/ABC/123/g", input_file, output_file [, option_string]) */
sed = hawk_sed_openstdwithmmgr(hawk_rtx_getgem(rtx), 0, hawk_rtx_getcmgr(rtx), HAWK_NULL); sed = hawk_sed_openstdwithmmgr(hawk_rtx_getmmgr(rtx), 0, hawk_rtx_getcmgr(rtx), HAWK_NULL);
if (sed == HAWK_NULL) if (sed == HAWK_NULL)
{ {
ret = -2; ret = -2;
@ -213,14 +213,7 @@ oops:
return 0; return 0;
} }
typedef struct fnctab_t fnctab_t; static hawk_mod_fnc_tab_t fnctab[] =
struct fnctab_t
{
const hawk_ooch_t* name;
hawk_mod_sym_fnc_t info;
};
static fnctab_t fnctab[] =
{ {
/* keep this table sorted for binary search in query(). */ /* keep this table sorted for binary search in query(). */
{ HAWK_T("file_to_file"), { { 3, 3, HAWK_NULL }, fnc_file_to_file, 0 } }, { HAWK_T("file_to_file"), { { 3, 3, HAWK_NULL }, fnc_file_to_file, 0 } },

View File

@ -61,6 +61,7 @@ CFLAGS="${RPM_OPT_FLAGS} -fPIC" CXXFLAGS="${RPM_OPT_FLAGS} -fPIC" ./configure \
%endif %endif
--with-mysql=yes \ --with-mysql=yes \
--enable-mod-mysql=yes \ --enable-mod-mysql=yes \
--enable-mod-sed=yes \
--enable-mod-uci=no ##CC=gcc44 CXX=g++44 --enable-mod-uci=no ##CC=gcc44 CXX=g++44
make make

View File

@ -51,7 +51,6 @@ static void test1 (void)
printf ("[%s]\n", HAWK_BECS_PTR(b)); printf ("[%s]\n", HAWK_BECS_PTR(b));
hawk_becs_close (b); hawk_becs_close (b);
return 0;
} }
static void test2 (void) static void test2 (void)
@ -71,8 +70,6 @@ static void test2 (void)
OK_X (q == 3); OK_X (q == 3);
OK_X (dst[q] == src[q]); OK_X (dst[q] == src[q]);
for (i = 0; i < q; i++) OK_X (dst[i] == sxx[i]); for (i = 0; i < q; i++) OK_X (dst[i] == sxx[i]);
return 0;
} }
hawk_bch_t* subst (hawk_bch_t* buf, hawk_oow_t bsz, const hawk_bcs_t* ident, void* ctx) hawk_bch_t* subst (hawk_bch_t* buf, hawk_oow_t bsz, const hawk_bcs_t* ident, void* ctx)
@ -105,8 +102,6 @@ static void test3 (void)
OK_X (hawk_count_bcstr(ptr) == 29); OK_X (hawk_count_bcstr(ptr) == 29);
OK_X (hawk_comp_bcstr(ptr, "USERNAME=sam,GROUPNAME=coders", 0) == 0); OK_X (hawk_comp_bcstr(ptr, "USERNAME=sam,GROUPNAME=coders", 0) == 0);
free (ptr); free (ptr);
return 0;
} }
int main () int main ()