]> git.draconx.ca Git - gob-dx.git/commitdiff
Release 1.0.5 v1.0.5
authorGeorge Lebl <jirka@5z.com>
Mon, 11 Sep 2000 15:07:00 +0000 (07:07 -0800)
committerNick Bowler <nbowler@draconx.ca>
Tue, 19 Feb 2019 17:20:19 +0000 (12:20 -0500)
12 files changed:
ChangeLog
NEWS
configure
configure.in
gob.m4
gob.spec
src/Makefile.in
src/checks.c
src/main.c
src/test.gob
src/util.c
src/util.h

index 7ebb14af3cf1363fc08ee1b82aa0d1e30a111ac9..ff9feb6a7e69978ab9ac4ca5c59110296dd843c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+Sun Sep 10 18:04:07 2000  George Lebl <jirka@5z.com>
+
+       * Release 1.0.5
+
+Fri Sep 01 03:45:30 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: add G_GNUC_CONST to the _get_type function
+
+Wed Aug 23 15:05:40 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: when a method has no arguments make an argumentless
+         macro for the shortform to avoid a parse error
+
+       * src/test.gob: add a test for the above
+
+Sun Aug  6 22:21:38 2000  Eskil Heyn Olsen <eskil@eazel.com>
+       
+       * gob.m4 now defaults to WARN instead of ERROR on missing
+       gob.
+
+Tue Jul 25 16:54:34 2000  George Lebl <jirka@5z.com>
+
+       * Release 1.0.4
+
+       * configure.in: raise version to 1.0.4
+
+       * src/main.c: fixup the -anal macro patch.
+
+       * src/util.[ch], src/main.c: constize (not in 1.0.4)
+
+       * src/main.c: the short form pointers unified for both gnu and non-gnu
+         (not in 1.0.4)
+
 Sun Jul 23 18:51:45 2000  George Lebl <jirka@5z.com>
 
        * src/util.[ch], src/main.c, src/checks.c, src/lexer.l, src/parse.y:
diff --git a/NEWS b/NEWS
index 3630887668176aa81922b07e7c9989d852e4d02f..53e39fd1713605d0f6cb969645663f7e769e0829 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+1.0.5
+       * gob.m4 defaults to WARN (Eskil)
+       * fix argumentless methods
+       * cleanup
+       * _get_type function is now G_GNUC_CONST
+
 1.0.4
        * Fix segfault in finalize
        * Minor fixes and improvements
index a2339ed7f139137add0a2b8214592832bd641170..d450c908e98ede9956dc937788d5e66953529fd5 100755 (executable)
--- a/configure
+++ b/configure
@@ -703,7 +703,7 @@ fi
 
 PACKAGE=gob
 
-VERSION=1.0.4
+VERSION=1.0.5
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
index 9a99c882518c67304f475c321d36c4587eddc247..cc30ff1638ccb807e9e1087c34375b973219ecfa 100644 (file)
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.2)
 AC_INIT(src/treefuncs.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(gob,1.0.4)
+AM_INIT_AUTOMAKE(gob,1.0.5)
 
 if test -f ../NOINST_GOB ; then
   DOINSTGOB=
diff --git a/gob.m4 b/gob.m4
index cb5ee77fc1f479b28d0b20c21fc96551c9bdf8c8..625007314202433d93cf84bf67e9cb87f5dd9fe0 100644 (file)
--- a/gob.m4
+++ b/gob.m4
@@ -4,7 +4,7 @@ dnl if fail = "failure", abort if GOB not found
 dnl
 
 
-AC_DEFUN([GOB_HOOK],[
+AC_DEFUN(GOB_HOOK,[
        AC_PATH_PROG(GOB,gob)
        if test ! x$GOB = x; then       
                if test ! x$1 = x; then 
@@ -54,5 +54,5 @@ AC_DEFUN([GOB_HOOK],[
 ])
 
 AC_DEFUN([GOB_CHECK],[
-       GOB_HOOK($1,[],[AC_MSG_ERROR([Cannot find GOB, check http://www.5z.com/jirka/gob.html])])
+       GOB_HOOK($1,[],[AC_MSG_WARN([Cannot find GOB, check http://www.5z.com/jirka/gob.html])])
 ])
index 5b9660432ddd783a1f747c99792161e9651925a4..8657e1a2ad18474c9815db275484013cfbb116e2 100644 (file)
--- a/gob.spec
+++ b/gob.spec
@@ -1,4 +1,4 @@
-%define  ver     1.0.4
+%define  ver     1.0.5
 %define  rel     1
 %define  prefix  /usr
 
index c27b02b2d2503ee8566423d05be29e76a84c3a0b..7646790c6f7a5ea511b380a67203165fa04f72a2 100644 (file)
@@ -326,7 +326,6 @@ main.o: main.c ../config.h treefuncs.h parse.h out.h util.h checks.h \
 out.o: out.c main.h out.h
 parse.o: parse.c ../config.h treefuncs.h main.h util.h
 treefuncs.o: treefuncs.c treefuncs.h
-tree.o: tree.c ../config.h tree.h
 util.o: util.c ../config.h treefuncs.h main.h util.h
 
 info-am:
index 9283309709a10ff696ca418dac220c3fc084614b..2bb3b69043b209cd28c6cebdce032c0c7c8c35fa 100644 (file)
 #include "checks.h"
 
 static void
-check_duplicate(Class *c, Node *node, char *id, int line_no,
+check_duplicate(Class *c, Node *node, const char *id, int line_no,
                gboolean underscore)
 {
        GList *l;
        for(l = c->nodes; l != NULL; l = g_list_next(l)) {
                Node *n = l->data;
-               char *nid;
+               const char *nid;
                int nline_no;
                gboolean here_underscore = FALSE;
                if(n->type == METHOD_NODE) {
@@ -183,12 +183,12 @@ check_bad_symbols(Class *c)
 }
 
 static void
-check_duplicate_named(Class *c, Node *node, char *id, int line_no)
+check_duplicate_named(Class *c, Node *node, const char *id, int line_no)
 {
        GList *l;
        for(l = c->nodes; l != NULL; l = g_list_next(l)) {
                Node *n = l->data;
-               char *nid;
+               const char *nid;
                int nline_no;
                if(n->type == METHOD_NODE) {
                        Method *m = (Method *)n;
index e145d643c73114aab8ad778355f358e21a4c0e7e..bf205ac9d2f16c7062b2742eb2041e94a234ea03 100644 (file)
@@ -127,7 +127,7 @@ make_bases(void)
 }
 
 static char *
-get_type(Type *t, gboolean postfix_to_stars)
+get_type(const Type *t, gboolean postfix_to_stars)
 {
        char *s;
        int i;
@@ -140,7 +140,7 @@ get_type(Type *t, gboolean postfix_to_stars)
 
        extra = 0;
        if(postfix_to_stars) {
-               char *p;
+               const char *p;
                /*XXX: this is ugly perhaps we can do this whole postfix thing
                  in a nicer way, we just count the number of '[' s and from
                  that we deduce the number of dimensions, so that we can print
@@ -163,7 +163,7 @@ get_type(Type *t, gboolean postfix_to_stars)
 }
 
 static char *
-get_gtk_doc(char *id)
+get_gtk_doc(const char *id)
 {
        char *val;
 
@@ -182,7 +182,7 @@ get_gtk_doc(char *id)
 }
 
 static void
-print_type(FILE *fp, Type *t, gboolean postfix_to_stars)
+print_type(FILE *fp, const Type *t, gboolean postfix_to_stars)
 {
        char *s;
 
@@ -193,15 +193,15 @@ print_type(FILE *fp, Type *t, gboolean postfix_to_stars)
 
 
 static void
-print_method(FILE *fp, char *typeprefix, char *nameprefix,
-            char *subnameprefix,
-            char *namepostfix, char *postfix, Method *m,
+print_method(FILE *fp, const char *typeprefix, const char *nameprefix,
+            const char *subnameprefix,
+            const char *namepostfix, const char *postfix, const Method *m,
             gboolean one_arg_per_line,
             gboolean no_funcbase,
             gboolean kill_underscore)
 {
        GList *li;
-       char *id;
+       const char *id;
 
        out_printf(fp, "%s", typeprefix); 
        print_type(fp, m->mtype, TRUE);
@@ -225,17 +225,17 @@ print_method(FILE *fp, char *typeprefix, char *nameprefix,
                        print_type(fp, arg->atype, FALSE);
                        if(li->next)
                                out_printf(fp, "%s%s,%s", arg->name,
-                                          arg->atype->postfix?
-                                          arg->atype->postfix:"",
-                                          one_arg_per_line?"\n\t\t\t\t\t":" ");
+                                          arg->atype->postfix ?
+                                          arg->atype->postfix : "",
+                                          one_arg_per_line ? "\n\t\t\t\t\t" : " ");
                        else
                                out_printf(fp, "%s%s", arg->name,
-                                          arg->atype->postfix?
-                                          arg->atype->postfix:""); 
+                                          arg->atype->postfix ?
+                                          arg->atype->postfix : ""); 
                }
                if(m->vararg)
                        out_printf(fp, ",%s...",
-                                  one_arg_per_line?"\n\t\t\t\t\t":" "); 
+                                  one_arg_per_line ? "\n\t\t\t\t\t" : " "); 
        } else {
                out_printf(fp, "void"); 
        }
@@ -264,12 +264,13 @@ any_method_to_alias(Class *c)
 }
 
 
+/* just the vararg macros, we use the same func pointers for these as in non-gnu */
 static void
 make_method_gnu_aliases(Class *c)
 {
        GList *li;
        
-       for(li=c->nodes;li;li=g_list_next(li)) {
+       for(li = c->nodes; li != NULL; li = li->next) {
                Node *node = li->data;
                if(node->type == METHOD_NODE) {
                        Method *m = (Method *)node;
@@ -283,13 +284,14 @@ make_method_gnu_aliases(Class *c)
                        if(for_cpp && strcmp(m->id, "new")==0)
                                continue;
 
-                       out_printf(out, "static const typeof(&%s_%s) %s "
-                                  "__attribute__ ((__unused__)) "
-                                  "= %s_%s;\n", funcbase, get_real_id(m->id),
-                                  m->id, funcbase, get_real_id(m->id));
-                       out_printf(out, "#define %s(args...) "
-                                  "%s_%s(##args)\n", m->id,
-                                  funcbase, get_real_id(m->id));
+                       if(m->args != NULL)
+                               out_printf(out, "#define %s(args...) "
+                                          "%s_%s(##args)\n", m->id,
+                                          funcbase, get_real_id(m->id));
+                       else
+                               out_printf(out, "#define %s() "
+                                          "%s_%s()\n", m->id,
+                                          funcbase, get_real_id(m->id));
                }
        }
 }
@@ -298,6 +300,8 @@ static void
 make_method_nongnu_aliases(Class *c)
 {
        GList *li;
+
+       gboolean local_made_aliases = FALSE;
        
        for(li=c->nodes; li; li=g_list_next(li)) {
                Node *node = li->data;
@@ -313,14 +317,21 @@ make_method_nongnu_aliases(Class *c)
                        if(for_cpp && strcmp(m->id, "new")==0)
                                continue;
 
-                       print_method(out, "static ", "(* ", "", ") ", "",
+                       if( ! local_made_aliases)
+                               out_printf(out, "\n/* Short form pointers */\n");
+
+                       print_method(out, "static ", "(* const ", "", ") ", "",
                                     m, FALSE, TRUE, FALSE);
                        out_printf(out, " = %s_%s;\n", funcbase,
                                   get_real_id(m->id));
 
-                       made_aliases = TRUE;
+                       local_made_aliases = TRUE;
                }
        }
+       if(local_made_aliases) {
+               out_printf(out, "\n");
+               made_aliases = TRUE;
+       }
 }
 
 static void
@@ -329,10 +340,10 @@ add_bad_hack_to_avoid_unused_warnings(Class *c)
        GList *li;
 
        /* if we haven't had any methods, just return */
-       if(!made_aliases)
+       if( ! made_aliases)
                return;
        
-       if(!no_gnu)
+       if( ! no_gnu)
                out_printf(out, "\n\n#if (!defined __GNUC__) || (defined __GNUC__ && defined __STRICT_ANSI__)\n");
        out_printf(out,
                   "/*REALLY BAD HACK\n"
@@ -382,7 +393,7 @@ put_variable(Variable *v, FILE *fp)
 }
 
 static void
-put_vs_method(Method *m)
+put_vs_method(const Method *m)
 {
        if(m->method != SIGNAL_LAST_METHOD &&
           m->method != SIGNAL_FIRST_METHOD &&
@@ -399,7 +410,7 @@ put_vs_method(Method *m)
 }
 
 static void
-put_pub_method(Method *m)
+put_pub_method(const Method *m)
 {
        if(m->scope != PUBLIC_SCOPE)
                return;
@@ -446,7 +457,7 @@ put_signal_connect(Method *m)
 
 
 static void
-put_prot_method(Method *m)
+put_prot_method(const Method *m)
 {
        if(m->scope != PROTECTED_SCOPE)
                return;
@@ -791,37 +802,40 @@ add_get_type(void)
 {
        char *chunk_size = ((Class*)class)->chunk_size;
        
-       out_printf(out, "guint\n"
-               "%s_get_type (void)\n"
-               "{\n"
-               "\tstatic guint type = 0;\n\n"
-               "\tif (!type) {\n"
-               "\t\tstatic const GtkTypeInfo info = {\n"
-               "\t\t\t\"%s\",\n"
-               "\t\t\tsizeof (%s),\n"
-               "\t\t\tsizeof (%sClass),\n"
-               "\t\t\t(GtkClassInitFunc) %s_class_init,\n"
-               "\t\t\t(GtkObjectInitFunc) %s_init,\n"
-               "\t\t\t/* reserved_1 */ NULL,\n"
-               "\t\t\t/* reserved_2 */ NULL,\n"
-               "\t\t\t(GtkClassInitFunc) NULL\n"
-               "\t\t};\n\n"
-               "\t\ttype = gtk_type_unique (%s_get_type(), &info);\n",
-               funcbase, typebase, typebase, typebase,
-               funcbase, funcbase, pfuncbase);
+       out_printf(out,
+                  "GtkType\n"
+                  "%s_get_type (void)\n"
+                  "{\n"
+                  "\tstatic guint type = 0;\n\n"
+                  "\tif ( ! type) {\n"
+                  "\t\tstatic const GtkTypeInfo info = {\n"
+                  "\t\t\t\"%s\",\n"
+                  "\t\t\tsizeof (%s),\n"
+                  "\t\t\tsizeof (%sClass),\n"
+                  "\t\t\t(GtkClassInitFunc) %s_class_init,\n"
+                  "\t\t\t(GtkObjectInitFunc) %s_init,\n"
+                  "\t\t\t/* reserved_1 */ NULL,\n"
+                  "\t\t\t/* reserved_2 */ NULL,\n"
+                  "\t\t\t(GtkClassInitFunc) NULL\n"
+                  "\t\t};\n\n"
+                  "\t\ttype = gtk_type_unique (%s_get_type(), &info);\n",
+                  funcbase, typebase, typebase, typebase,
+                  funcbase, funcbase, pfuncbase);
        if(chunk_size)  {
-               out_printf(out, "#if %s > 0\n"
-                               "\t\tgtk_type_set_chunk_alloc(type,%s);\n"
-                               "#endif\n", 
-                               chunk_size,  chunk_size);
-       }
-       out_printf(out,"\t}\n\n"
-               "\treturn type;\n"
-               "}\n\n");
+               out_printf(out,
+                          "#if %s > 0\n"
+                          "\t\tgtk_type_set_chunk_alloc(type, %s);\n"
+                          "#endif\n", 
+                          chunk_size, chunk_size);
+       }
+       out_printf(out,
+                  "\t}\n\n"
+                  "\treturn type;\n"
+                  "}\n\n");
 }
 
 static void
-add_overrides(Class *c, char *oname, gboolean did_base_obj)
+add_overrides(Class *c, const char *oname, gboolean did_base_obj)
 {
        GList *li;
        GHashTable *done;
@@ -1017,7 +1031,7 @@ add_signals(Class *c)
 }
 
 static void
-set_def_handlers(Class *c, char *oname)
+set_def_handlers(Class *c, const char *oname)
 {
        GList *li;
        gboolean set_line = FALSE;
@@ -1073,11 +1087,11 @@ set_def_handlers(Class *c, char *oname)
                } else {
                        if(m->cbuf)
                                out_printf(out, "\t%s->%s = ___real_%s_%s;\n",
-                                       oname, get_real_id(m->id),
-                                       funcbase, get_real_id(m->id));
+                                          oname, get_real_id(m->id),
+                                          funcbase, get_real_id(m->id));
                        else
                                out_printf(out, "\t%s->%s = NULL;\n",
-                                       oname, get_real_id(m->id));
+                                          oname, get_real_id(m->id));
                }
        }
        if(set_line)
@@ -2274,7 +2288,13 @@ print_class_block(Class *c)
                   " * Public methods\n"
                   " */\n");
 
-       out_printf(outh, "guint\t%s_get_type\t(void);\n", funcbase);
+       out_printf(outh, "GtkType\t%s_get_type\t(void)", funcbase);
+       if ( ! no_gnu) {
+               out_printf(outh, " G_GNUC_CONST;\n");
+       } else {
+               out_printf(outh, ";\n");
+       }
+
        for(l = c->nodes; l != NULL; l = l->next) {
                Node *n = l->data;
                if(n->type == METHOD_NODE) {
@@ -2334,15 +2354,13 @@ print_class_block(Class *c)
        add_get_type();
 
        if(any_method_to_alias(c)) {
-               if(no_gnu)
-                       make_method_nongnu_aliases(c);
-               else {
-                       out_printf(out, "\n#if defined(__GNUC__) && !defined(__STRICT_ANSI__)\n");
+               if( ! no_gnu) {
+                       out_printf(out, "/* Short form macros */\n");
+                       out_printf(out, "#if defined(__GNUC__) && !defined(__STRICT_ANSI__)\n");
                        make_method_gnu_aliases(c);
-                       out_printf(out, "#else /* __GNUC__ && !__STRICT_ANSI__ */\n");
-                       make_method_nongnu_aliases(c);
-                       out_printf(out, "#endif /* __GNUC__ && !__STRICT_ANSI__ */\n\n");
+                       out_printf(out, "#endif /* __GNUC__ && !__STRICT_ANSI__ */\n");
                }
+               make_method_nongnu_aliases(c);
        }
 
        out_printf(out, "/* a macro for creating a new object of our type */\n");
@@ -2399,6 +2417,8 @@ print_file_comments(void)
        out_printf(out, "/* Generated by GOB (v%s) on %s"
                   "   (do not edit directly) */\n\n",
                   VERSION, ctime(&curtime));
+
+       out_printf(out, "/* End world hunger, donate to the World Food Programme, http://www.wfp.org */\n\n");
 }
 
 static void
index 17a824487aadf15220fb381d9ee7375eaa383c9f..36fe62b1f94bc876903248163234dacee4244bc0 100644 (file)
@@ -383,6 +383,18 @@ class Gtk:Weird:Button from Gtk:Button {
        public const gchar * const t17;
        public const gchar t18;
 
+       /* testing method with no arguments */
+       public void method_with_no_arguments (void)
+       {
+               /* FOO */
+       }
+
+       /* testing calling the above method */
+       public void foo (self) {
+               method_with_no_arguments ();
+       }
+
+
        /* testing empty statements */
        ;
        ;
index 37abe55cfe3b9243ef61449f435503d3fa27f158..acc112e0757ab42424ea10dd02612795128ff6ed 100644 (file)
@@ -72,7 +72,7 @@ error_printf(int type, int line, const char *error, ...)
 }
 
 char *
-remove_sep(char *base)
+remove_sep(const char *base)
 {
        char *p;
        char *s = g_strdup(base);
@@ -277,12 +277,12 @@ setup_special_array(Class *c, gboolean *special_array)
 }
 
 /* get the id without the first underscore, but only if we're removing them */
-char *
-get_real_id(char *id)
+const char *
+get_real_id(const char *id)
 {
-       if(!no_kill_underscores &&
-          id[0] == '_' &&
-          id[1] != '\0')
+       if( ! no_kill_underscores &&
+           id[0] == '_' &&
+           id[1] != '\0')
                return &id[1];
        else
                return id;
index 9eac4464ac2c3b689bdf9c7e4193b1822165c54c..20692b0de46e02ec0c151ffa35c9b94e27fd919e 100644 (file)
@@ -34,7 +34,7 @@ void error_print(int type, int line, const char *error);
 void error_printf(int type, int line, const char *error, ...) G_GNUC_PRINTF (3, 4);
 
 /* remove the : separator from a typename */
-char * remove_sep(char *base);
+char * remove_sep(const char *base);
 /* replace the : separator from a typename with a different character*/
 char * replace_sep(const char *base, char r);
 
@@ -59,7 +59,7 @@ enum {
 gboolean setup_special_array(Class *c, gboolean *special_array);
 
 /* get the id without the first underscore, but only if we're removing them */
-char *get_real_id(char *id);
+const char *get_real_id(const char *id);
 
 #endif