chiark / gitweb /
fix up compilation errors
authorian <ian>
Fri, 20 Oct 2006 11:27:42 +0000 (11:27 +0000)
committerian <ian>
Fri, 20 Oct 2006 11:27:42 +0000 (11:27 +0000)
adns/adns.c

index a21de019793630c466524fbcce689e4f22d4fc03..6ab062b1069f9bef6d86438229025759f885e5d2 100644 (file)
@@ -198,6 +198,14 @@ struct Resolver {
   Tcl_Obj *errstring_accum;
 };
 
+struct Query {
+  int ix; /* first! */
+  Resolver *res;
+  adns_query aqu;
+  ScriptToInvoke on_yes, on_no, on_fail;
+  Tcl_Obj *xargs;
+};
+
 /* The default resolver is recorded using Tcl_SetAssocData with key
  * ASSOC_DEFAULTRES to record the Resolver*.  If it was explicitly
  * created with `adns new-resolver' then ix will be >=0, and the
@@ -284,6 +292,7 @@ static Resolver *default_resolver(Tcl_Interp *ip) {
 
 static void destroy_resolver(Tcl_Interp *ip, Resolver *res) {
   void *query_v;
+  Query *query;
   int logstring_len;
   char *rstr;
   adns_query aqu;
@@ -305,8 +314,9 @@ static void destroy_resolver(Tcl_Interp *ip, Resolver *res) {
       adns_forallqueries_begin(res->ads);
       aqu= adns_forallqueries_next(res->ads, &query_v);
       if (!aqu) break;
-      assert(query_v->aqu == aqu);
-      query_v->aqu= 0; /* avoid disrupting the adns query list */
+      query= query_v;
+      assert(query->aqu == aqu);
+      query->aqu= 0; /* avoid disrupting the adns query list */
       asynch_query_dispose(ip, query_v);
     }
     adns_finish(res->ads);
@@ -616,14 +626,6 @@ int cht_do_adns_synch(ClientData cd, Tcl_Interp *ip,
 
 /*---------- asynchronous query handling ----------*/
 
-struct Query {
-  int ix; /* first! */
-  Resolver *res;
-  adns_query aqu;
-  ScriptToInvoke on_yes, on_no, on_fail;
-  Tcl_Obj *xargs;
-};
-
 static void asynch_check_now(Resolver *res);
 
 static void asynch_timerhandler(void *res_v) {