With this check-in, syck is more-or-less in the same state
as when syck was dropped immediately after rpm5.org
was started.
The main difference now is that syck is a toplevel cvs module rather
than a cancerous snarl within rpm cvs. That's good.
I will continue integrating with the usual internal/external AutoFu
as devel
progresses. What I needed atm was a reference library that isn't
going to change
randomly for reasons that I have no control over.
The visible proof-of-concept deliverable will be a parser
for externally configured triggers in /etc/rpm/sysinfo/Triggername
as described in another message.
The other usage case will be either a C/lua well-formedness test
for rpm --yaml within rpm "make check". I still am mistrustful
that all the esaping and indenting in the :yaml format extension
is relaible because of the lack of automated tests.
I had hoped that libyaml would be more widely accepted than syck
by now, but OSSification seems to be rampant.
So getting an abstraction layer into rpmio on top of both syck/yaml
will be needed before rpm can routinely use a YAML parser.
73 de Jeff
On Oct 17, 2008, at 6:00 PM, Jeff Johnson wrote:
> RPM Package Manager, CVS Repository
> http://rpm5.org/cvs/
>
> ______________________________________________________________________
> ______
>
> Server: rpm5.org Name: Jeff Johnson
> Root: /v/rpm/cvs Email: jbj@rpm5.org
> Module: syck Date: 18-Oct-2008
> 00:00:13
> Branch: HEAD Handle: 2008101722001300
>
> Added files:
> syck/lib .splintrc
> Modified files:
> syck/lib Makefile.am emitter.c handler.c syck.c
> syck.h
>
> Log:
> - jbj: build & check syck standalone.
>
> Summary:
> Revision Changes Path
> 1.1 +94 -0 syck/lib/.splintrc
> 1.3 +31 -10 syck/lib/Makefile.am
> 1.4 +5 -5 syck/lib/emitter.c
> 1.3 +5 -5 syck/lib/handler.c
> 1.3 +1 -1 syck/lib/syck.c
> 1.3 +1 -1 syck/lib/syck.h
>
> ______________________________________________________________________
> ______
>
> patch -p0 <<'@@ .'
> Index: syck/lib/.splintrc
>
> ======================================================================
> ======
> $ cvs diff -u -r0 -r1.1 .splintrc
> --- /dev/null 2008-10-18 00:00:10 +0200
> +++ .splintrc 2008-10-18 00:00:13 +0200
> @@ -0,0 +1,94 @@
> +-I. -I.. -DHAVE_CONFIG_H -D_GNU_SOURCE -D__STDC__=1
> +
> ++partial
> ++forcehints
> +
> +-warnposix
> +
> ++unixlib
> +
> +-unrecogcomments # XXX ignore doxygen markings
> +
> ++strict # lclint level
> +
> +# --- in progress
> +-branchstate
> +-bufferoverflowhigh
> +
> +-compdef
> +-compmempass
> +-dependenttrans
> +-evalorder
> +-exportheader
> +-globs
> +-ifempty
> +-immediatetrans
> +-internalglobs
> +-kepttrans
> +-modfilesys
> +-modnomods
> +-mods
> +-moduncon
> +-modunconnomods
> +-noeffect
> +-noeffectuncon
> +-nullassign
> +-nullderef
> +-nullpass
> +-nullptrarith
> +-nullret
> +-nullstate
> +-predboolothers
> +-readonlytrans
> +-redecl
> +-redef
> +-retalias
> +-retvalint
> +-shiftimplementation
> +-sizeoftype
> +-temptrans
> +-type
> +-uniondef
> +-usereleased
> +-warnlintcomments
> +
> +# --- +partial artifacts
> +-declundef
> +-exportheadervar
> +-exportlocal
> +
> +-enummemuse
> +-fcnuse
> +-typeuse
> +-varuse
> +
> +# --- not-yet at strict level
> +-bitwisesigned
> +-elseifcomplete
> +-exportconst
> +-exportfcn
> +-exporttype
> +-exportvar
> +-fielduse
> +-forblock
> +-ifblock
> +-namechecks
> +-ptrarith
> +
> +-compdestroy
> +-mustdefine
> +-sys-dir-errors
> +
> +-strictops
> +-whileblock
> +
> +# --- not-yet at checks level
> ++enumint
> +-mustfree
> +-predboolptr
> +-usedef
> +
> +# --- not-yet at standard level
> +-boolops
> ++boolint
> ++ignorequals
> @@ .
> patch -p0 <<'@@ .'
> Index: syck/lib/Makefile.am
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2 -r1.3 Makefile.am
> --- syck/lib/Makefile.am 17 Oct 2008 20:03:39 -0000 1.2
> +++ syck/lib/Makefile.am 17 Oct 2008 22:00:13 -0000 1.3
> @@ -8,16 +8,16 @@
> include_HEADERS = syck.h syck_st.h
>
> libsyck_la_SOURCES = \
> - emitter.c \
> - handler.c \
> - node.c \
> - syck.c \
> - syck_st.c \
> - gram.y \
> - bytecode.re \
> - yaml2byte.c \
> - token.re \
> - implicit.re
> + emitter.c \
> + handler.c \
> + node.c \
> + syck.c \
> + syck_st.c \
> + gram.y \
> + bytecode.re \
> + yaml2byte.c \
> + token.re \
> + implicit.re
>
> # CURRENT:REVISION:AGE
> # Bump REVISION if there's no API or ABI changes.
> @@ -30,3 +30,24 @@
> .re.c:
> $(REC) $< > $@.new && mv $@.new $@
>
> +LINT = splint
> +
> +SYCK_SPLINT_SRCS = \
> + emitter.c \
> + handler.c \
> + node.c \
> + syck.c \
> + syck_st.c \
> + gram.c \
> + bytecode.c \
> + yaml2byte.c \
> + token.c \
> + implicit.c
> +
> +.PHONY: sources
> +sources:
> + @echo $(SYCK_SPLINT_SRCS:%=syck/lib/%)
> +
> +.PHONY: lint
> +lint:
> + $(LINT) $(DEFS) $(INCLUDES) $(SYCK_SPLINT_SRCS)
> @@ .
> patch -p0 <<'@@ .'
> Index: syck/lib/emitter.c
>
> ======================================================================
> ======
> $ cvs diff -u -r1.3 -r1.4 emitter.c
> --- syck/lib/emitter.c 17 Oct 2008 20:45:32 -0000 1.3
> +++ syck/lib/emitter.c 17 Oct 2008 22:00:13 -0000 1.4
> @@ -399,8 +399,8 @@
>
> /* Look for anchor */
> if ( e->anchors != NULL &&
> - st_lookup( e->markers, n, (st_data_t *)&oid ) &&
> - st_lookup( e->anchors, (st_data_t)oid, (st_data_t *)
> &anchor_name ) )
> + st_lookup( e->markers, n, (void *)&oid ) &&
> + st_lookup( e->anchors, (st_data_t)oid, (void *)
> &anchor_name ) )
> {
> if ( e->anchored == NULL )
> {
> @@ -409,7 +409,7 @@
> assert(e->anchored != NULL);
> assert(anchor_name != NULL);
>
> - if ( ! st_lookup( e->anchored, (st_data_t)anchor_name,
> (st_data_t *)&x ) )
> + if ( ! st_lookup( e->anchored, (st_data_t)anchor_name,
> (void *)&x ) )
> {
> char *an = S_ALLOC_N( char, strlen( anchor_name ) +
> 3 );
> sprintf( an, "&%s ", anchor_name );
> @@ -1244,7 +1244,7 @@
> * object. Doesn't yet create an anchor, simply notes the
> * position.
> */
> - if ( ! st_lookup( e->markers, n, (st_data_t *)&oid ) )
> + if ( ! st_lookup( e->markers, n, (void *)&oid ) )
> {
> /*
> * Store all markers
> @@ -1260,7 +1260,7 @@
> }
> assert(e->anchors != NULL);
>
> - if ( ! st_lookup( e->anchors, (st_data_t)oid, (st_data_t
> *)&anchor_name ) )
> + if ( ! st_lookup( e->anchors, (st_data_t)oid, (void *)
> &anchor_name ) )
> {
> int idx = 0;
> char *anc = ( e->anchor_format == NULL ?
> DEFAULT_ANCHOR_FORMAT : e->anchor_format );
> @@ .
> patch -p0 <<'@@ .'
> Index: syck/lib/handler.c
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2 -r1.3 handler.c
> --- syck/lib/handler.c 17 Oct 2008 20:45:32 -0000 1.2
> +++ syck/lib/handler.c 17 Oct 2008 22:00:13 -0000 1.3
> @@ -38,7 +38,7 @@
> if ( p->bad_anchors != NULL )
> {
> SyckNode *bad;
> - if ( st_lookup( p->bad_anchors, (st_data_t)a, (st_data_t
> *)&bad ) )
> + if ( st_lookup( p->bad_anchors, (st_data_t)a, (void *)
> &bad ) )
> {
> if ( n->kind != syck_str_kind )
> {
> @@ -54,7 +54,7 @@
> p->anchors = st_init_strtable();
> }
> assert(p->anchors != NULL);
> - if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)
> &ntmp ) )
> + if ( st_lookup( p->anchors, (st_data_t)a, (void *)&ntmp ) )
> {
> if ( ntmp != (void *)1 )
> {
> @@ -75,7 +75,7 @@
> p->anchors = st_init_strtable();
> }
> assert(p->anchors != NULL);
> - if ( st_delete( p->anchors, (st_data_t *)&atmp, (st_data_t *)
> &ntmp ) )
> + if ( st_delete( p->anchors, (void *)&atmp, (void *)&ntmp ) )
> {
> if ( ntmp != (void *)1 )
> {
> @@ -93,7 +93,7 @@
>
> if ( p->anchors != NULL )
> {
> - if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)
> &n ) )
> + if ( st_lookup( p->anchors, (st_data_t)a, (void *)&n ) )
> {
> if ( n != (void *)1 )
> {
> @@ -107,7 +107,7 @@
> p->bad_anchors = st_init_strtable();
> }
> assert(p->bad_anchors != NULL);
> - if ( ! st_lookup( p->bad_anchors, (st_data_t)a,
> (st_data_t *)&n ) )
> + if ( ! st_lookup( p->bad_anchors, (st_data_t)a,
> (void *)&n ) )
> {
> n = (p->bad_anchor_handler)( p, a );
> st_insert( p->bad_anchors, (st_data_t)a,
> (st_data_t)n );
> @@ .
> patch -p0 <<'@@ .'
> Index: syck/lib/syck.c
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2 -r1.3 syck.c
> --- syck/lib/syck.c 17 Oct 2008 20:45:32 -0000 1.2
> +++ syck/lib/syck.c 17 Oct 2008 22:00:13 -0000 1.3
> @@ -206,7 +206,7 @@
> syck_lookup_sym( SyckParser *p, SYMID id, char **data )
> {
> if ( p->syms == NULL ) return 0;
> - return st_lookup( p->syms, (st_data_t)id, (st_data_t *)data );
> + return st_lookup( p->syms, (st_data_t)id, (void *)data );
> }
>
> enum st_retval
> @@ .
> patch -p0 <<'@@ .'
> Index: syck/lib/syck.h
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2 -r1.3 syck.h
> --- syck/lib/syck.h 17 Oct 2008 20:45:32 -0000 1.2
> +++ syck/lib/syck.h 17 Oct 2008 22:00:13 -0000 1.3
> @@ -60,7 +60,7 @@
> #define S_ALLOC_N(type,n) (type*)xmalloc(sizeof(type)*(n))
> #define S_ALLOC(type) (type*)xmalloc(sizeof(type))
> #define S_REALLOC_N(var,type,n) (var)=(type*)xrealloc((char*)
> (var),sizeof(type)*(n))
> -#define S_FREE(n) free(n); n = NULL;
> +#define S_FREE(n) free((void *)n); n = NULL;
>
> #define S_ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n))
>
> @@ .
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> CVS Sources Repository rpm-cvs@rpm5.org
Received on Sat Oct 18 00:25:18 2008