Oaf clean.
- From: Michael Meeks <michael helixcode com>
- To: gnome-components-list gnome org
- Subject: Oaf clean.
- Date: Fri, 26 May 2000 07:10:53 -0400 (EDT)
This patch kills all the compile time warnings I could fix off hand,
it expands the tests and cleans some things.
If no one complains I will commit it.
Regards,
Michael.
? mjs
? liboaf/a.out
? liboaf/a.c
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/oaf/ChangeLog,v
retrieving revision 1.15
diff -u -r1.15 ChangeLog
--- ChangeLog 2000/05/24 14:23:09 1.15
+++ ChangeLog 2000/05/26 11:09:25
@@ -1,3 +1,16 @@
+2000-05-26 Michael Meeks <michael@helixcode.com>
+
+ * test/oaf-run-query.c (main): sort comments.
+
+ * test/Makefile.am: Stupid cut and paste error fixed, re-instating the
+ test client, doh.
+
+ * test/oaf-test-client.c (test_empty): split.
+ (main): expand.
+
+ * oafd/ac-query-expr.c (qexp_sort): cast sort_compare to right type,
+ include qsort_ex.h
+
2000-05-24 Michael Meeks <michael@helixcode.com>
* docs/query-language.txt: Fix typo in example code.
Index: oafd/ac-corba.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/ac-corba.c,v
retrieving revision 1.18
diff -u -r1.18 ac-corba.c
--- oafd/ac-corba.c 2000/05/07 18:34:15 1.18
+++ oafd/ac-corba.c 2000/05/26 11:09:25
@@ -1,8 +1,10 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+#include <stdio.h>
+#include <time.h>
+
#include "oafd.h"
#include "liboaf/liboaf.h"
#include "ac-query-expr.h"
-#include <time.h>
static void
OAF_ServerInfo__copy (OAF_ServerInfo * new, const OAF_ServerInfo * old)
Index: oafd/ac-query-expr.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/ac-query-expr.c,v
retrieving revision 1.17
diff -u -r1.17 ac-query-expr.c
--- oafd/ac-query-expr.c 2000/05/07 18:34:15 1.17
+++ oafd/ac-query-expr.c 2000/05/26 11:09:25
@@ -7,6 +7,7 @@
#include "ac-query-expr.h"
#include "ac-query-parse.h"
+#include "qsort_ex.h"
static QueryExpr *
qexp_new (void)
@@ -634,8 +635,6 @@
qexp_func_defined (OAF_ServerInfo * si, QueryExpr * e, QueryContext * qctx)
{
QueryExprConst retval, v1;
- char **check_one, *check_two;
- int i;
v1 = qexp_evaluate (si, e->u.function_value.arguments->data, qctx);
@@ -1113,8 +1112,6 @@
qexp_sort (OAF_ServerInfo ** servers, int nservers, QueryExpr ** sexps,
int nexps, QueryContext * qctx)
{
- int n, h, i, j;
- OAF_ServerInfo *t;
QexpSortData sort_data;
sort_data.sexps = sexps;
@@ -1122,5 +1119,5 @@
sort_data.qctx = qctx;
qsort_ex (servers, nservers, sizeof (OAF_ServerInfo *),
- qexp_sort_compare, &sort_data);
+ (compar_ex_fn_t)qexp_sort_compare, &sort_data);
}
Index: oafd/client.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/client.c,v
retrieving revision 1.5
diff -u -r1.5 client.c
--- oafd/client.c 2000/05/07 18:34:15 1.5
+++ oafd/client.c 2000/05/26 11:09:25
@@ -79,7 +79,7 @@
CORBA_exception_init (&ev);
- ctx = poptGetContext ("oaf-client", argc, argv, options, 0);
+ ctx = poptGetContext ("oaf-client", argc, (const char **)argv, options, 0);
while (poptGetNextOpt (ctx) >= 0)
/**/;
Index: oafd/main.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/main.c,v
retrieving revision 1.11
diff -u -r1.11 main.c
--- oafd/main.c 2000/05/16 00:34:56 1.11
+++ oafd/main.c 2000/05/26 11:09:25
@@ -67,7 +67,7 @@
CORBA_exception_init (&ev);
- ctx = poptGetContext ("oafd", argc, argv, options, 0);
+ ctx = poptGetContext ("oafd", argc, (const char **)argv, options, 0);
while (poptGetNextOpt (ctx) >= 0)
/**/;
@@ -80,7 +80,6 @@
CORBA_ORB_resolve_initial_references (orb, "RootPOA", &ev);
{
char *env_od_source_dir;
- char *gnome_env_od_source_dir;
GString *real_od_source_dir;
real_od_source_dir = g_string_new (OAFINFODIR);
Index: oafd/od-corba.c
===================================================================
RCS file: /cvs/gnome/oaf/oafd/od-corba.c,v
retrieving revision 1.17
diff -u -r1.17 od-corba.c
--- oafd/od-corba.c 2000/05/16 00:34:56 1.17
+++ oafd/od-corba.c 2000/05/26 11:09:26
@@ -1,6 +1,8 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
#include "config.h"
+#include <stdio.h>
+
#include "oafd.h"
#include "liboaf/liboaf.h"
#include <time.h>
Index: test/Makefile.am
===================================================================
RCS file: /cvs/gnome/oaf/test/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- test/Makefile.am 2000/05/10 06:15:28 1.7
+++ test/Makefile.am 2000/05/26 11:09:26
@@ -3,7 +3,7 @@
oaf_test_client_SOURCES=oaf-test-client.c empty-common.c empty.h empty-stubs.c
-oaf_test_client_SOURCES=oaf-run-query.c empty-common.c empty.h empty-stubs.c
+oaf_run_query_SOURCES=oaf-run-query.c empty-common.c empty.h empty-stubs.c
oaf_empty_server_SOURCES=empty-server.c empty.h empty-common.c empty-skels.c
Index: test/empty-server.c
===================================================================
RCS file: /cvs/gnome/oaf/test/empty-server.c,v
retrieving revision 1.5
diff -u -r1.5 empty-server.c
--- test/empty-server.c 2000/05/07 18:34:16 1.5
+++ test/empty-server.c 2000/05/26 11:09:26
@@ -44,9 +44,8 @@
CORBA_exception_init (&ev);
orb = oaf_init (argc, argv);
- ctx =
- poptGetContext ("oaf-empty-server", argc, argv,
- oaf_popt_options, 0);
+ ctx = poptGetContext ("oaf-empty-server", argc, (const char **)argv,
+ oaf_popt_options, 0);
while (poptGetNextOpt (ctx) >= 0);
poptFreeContext (ctx);
Index: test/empty.oafinfo
===================================================================
RCS file: /cvs/gnome/oaf/test/empty.oafinfo,v
retrieving revision 1.2
diff -u -r1.2 empty.oafinfo
--- test/empty.oafinfo 1999/10/25 23:07:41 1.2
+++ test/empty.oafinfo 2000/05/26 11:09:26
@@ -1,5 +1,5 @@
<oaf_server iid="OAFIID:Empty:19991025" type="exe" location="./oaf-empty-server">
<oaf_attribute name="repo_ids" type="stringv">
-<item value="IDL:Empty:1.0"/>
+ <item value="IDL:Empty:1.0"/>
</oaf_attribute>
</oaf_server>
Index: test/oaf-run-query.c
===================================================================
RCS file: /cvs/gnome/oaf/test/oaf-run-query.c,v
retrieving revision 1.3
diff -u -r1.3 oaf-run-query.c
--- test/oaf-run-query.c 2000/05/07 18:34:16 1.3
+++ test/oaf-run-query.c 2000/05/26 11:09:26
@@ -1,5 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
#include <liboaf/liboaf.h>
+#include <stdio.h>
#include <stdlib.h>
#include "empty.h"
@@ -8,7 +9,6 @@
{
OAF_ServerInfoList *result;
CORBA_Environment ev;
- OAF_ActivationID aid;
char *query;
char **sort_criteria;
int i;
@@ -44,10 +44,10 @@
query = "repo_ids.has('IDL:Empty:1.0')";
}
- // putenv("OAF_BARRIER_INIT=1");
+ /* putenv("OAF_BARRIER_INIT=1"); */
result = oaf_query (query, sort_criteria, &ev);
- // result = oaf_query ("iid == 'OAFIID:Empty:19991025'", NULL, &ev);
+ /* result = oaf_query ("iid == 'OAFIID:Empty:19991025'", NULL, &ev); */
if (result == NULL) {
puts ("query failed");
Index: test/oaf-test-client.c
===================================================================
RCS file: /cvs/gnome/oaf/test/oaf-test-client.c,v
retrieving revision 1.4
diff -u -r1.4 oaf-test-client.c
--- test/oaf-test-client.c 2000/05/07 18:34:16 1.4
+++ test/oaf-test-client.c 2000/05/26 11:09:26
@@ -1,8 +1,28 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
#include <liboaf/liboaf.h>
+#include <stdio.h>
#include <stdlib.h>
#include "empty.h"
+void
+test_empty (CORBA_Object obj, CORBA_Environment *ev, const char *type)
+{
+ if (CORBA_Object_is_nil (obj, ev)) {
+ g_warning ("Activation %s failed!", type);
+
+ } else if (ev->_major != CORBA_NO_EXCEPTION) {
+ g_warning ("Activation %s failed: %s\n", type,
+ CORBA_exception_id (ev));
+ } else {
+ Empty_doNothing (obj, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ g_warning ("Call failed: %s\n",
+ CORBA_exception_id (ev));
+ else
+ fprintf (stderr, "Test %s succeeded\n", type);
+ }
+}
+
int
main (int argc, char *argv[])
{
@@ -12,22 +32,19 @@
CORBA_exception_init (&ev);
oaf_init (argc, argv);
-// putenv("OAF_BARRIER_INIT=1");
- obj =
- oaf_activate ("repo_ids.has('IDL:Empty:1.0')", NULL, 0, NULL,
- &ev);
-
- if (CORBA_Object_is_nil (obj, &ev)) {
- g_warning ("Activation failed!");
- } else if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Activation failed: %s\n",
- CORBA_exception_id (&ev));
- } else {
- Empty_doNothing (obj, &ev);
- if (ev._major != CORBA_NO_EXCEPTION)
- g_warning ("Call failed: %s\n",
- CORBA_exception_id (&ev));
- }
+/* putenv("OAF_BARRIER_INIT=1"); */
+ obj = oaf_activate ("repo_ids.has('IDL:Empty:1.0')", NULL, 0, NULL,
+ &ev);
+
+ test_empty (obj, &ev, "by query");
+
+ obj = oaf_activate_from_id ("OAFIID:Empty:19991025", 0, NULL, &ev);
+
+ test_empty (obj, &ev, "from id");
+
+ obj = oaf_activate_from_id ("OAFAID:[OAFIID:Empty:19991025]", 0, NULL, &ev);
+
+ test_empty (obj, &ev, "from aid");
CORBA_exception_free (&ev);
--
mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]