Skip to content

Commit

Permalink
* st.h: define ST_DATA_T_DEFINED for portability.
Browse files Browse the repository at this point in the history
* ext/syck/syck.h: add typedef, st_data_t for Ruby 1.6.

* ext/syck/syck.c (syck_st_free_nodes): return int.

* ext/syck/syck.c (syck_add_sym): cast the data to st_data_t
  to avoid error on bcc32.

* ext/syck/syck.c (syck_lookup_sym): ditto.

* ext/syck/syck.c (syck_free_parser): NULL is not integer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
eban committed May 20, 2003
1 parent 82cf989 commit b614db0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Tue May 20 15:26:25 2003 WATANABE Hirofumi <[email protected]>

* st.h: define ST_DATA_T_DEFINED for portability.

* ext/syck/syck.h: add typedef, st_data_t for Ruby 1.6.

* ext/syck/syck.c (syck_st_free_nodes): return int.

* ext/syck/syck.c (syck_add_sym): cast the data to st_data_t
to avoid error on bcc32.

* ext/syck/syck.c (syck_lookup_sym): ditto.

* ext/syck/syck.c (syck_free_parser): NULL is not integer.

Tue May 20 13:29:04 2003 NAKAMURA Usaku <[email protected]>

* win32/win32.c (kill): set errno after calling raise().
Expand Down
8 changes: 4 additions & 4 deletions ext/syck/syck.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ syck_add_sym( SyckParser *p, char *data )
p->syms = st_init_numtable();
}
id = p->syms->num_entries;
st_insert( p->syms, id, data );
st_insert( p->syms, id, (st_data_t)data );
return id;
}

int
syck_lookup_sym( SyckParser *p, SYMID id, char **data )
{
if ( p->syms == NULL ) return 0;
return st_lookup( p->syms, id, data );
return st_lookup( p->syms, id, (st_data_t *)data );
}

enum st_retval
int
syck_st_free_nodes( char *key, SyckNode *n, char *arg )
{
syck_free_node( n );
Expand All @@ -223,7 +223,7 @@ syck_free_parser( SyckParser *p )
//
// Free the anchor table
//
st_foreach( p->anchors, syck_st_free_nodes, NULL );
st_foreach( p->anchors, syck_st_free_nodes, 0 );
st_free_table( p->anchors );

//
Expand Down
6 changes: 5 additions & 1 deletion ext/syck/syck.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define YAML_DOMAIN "yaml.org,2002"

#include <stdio.h>
#include "../../st.h"
#include "st.h"

#if defined(__cplusplus)
extern "C" {
Expand Down Expand Up @@ -257,6 +257,10 @@ long syck_seq_count( SyckNode * );

void apply_seq_in_map( SyckParser *, SyckNode * );

#ifndef ST_DATA_T_DEFINED
typedef long st_data_t;
#endif

#if defined(__cplusplus)
} /* extern "C" { */
#endif
Expand Down
1 change: 1 addition & 0 deletions st.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define ST_INCLUDED

typedef long st_data_t;
#define ST_DATA_T_DEFINED

typedef struct st_table st_table;

Expand Down

0 comments on commit b614db0

Please sign in to comment.