[111464] trunk/dports/devel/libut

jmr at macports.org jmr at macports.org
Mon Sep 23 07:42:42 PDT 2013


Revision: 111464
          https://trac.macports.org/changeset/111464
Author:   jmr at macports.org
Date:     2013-09-23 07:42:42 -0700 (Mon, 23 Sep 2013)
Log Message:
-----------
libut: fix buggy code that clang rejects

Modified Paths:
--------------
    trunk/dports/devel/libut/Portfile

Added Paths:
-----------
    trunk/dports/devel/libut/files/connect.c.patch
    trunk/dports/devel/libut/files/coproc.c.patch
    trunk/dports/devel/libut/files/coproc_shl.c.patch
    trunk/dports/devel/libut/files/coprocess.c.patch
    trunk/dports/devel/libut/files/fd.c.patch
    trunk/dports/devel/libut/files/hash.h.patch
    trunk/dports/devel/libut/files/init.c.patch
    trunk/dports/devel/libut/files/int.c.patch
    trunk/dports/devel/libut/files/iob.c.patch
    trunk/dports/devel/libut/files/listen.c.patch
    trunk/dports/devel/libut/files/log.c.patch
    trunk/dports/devel/libut/files/log_shl.c.patch
    trunk/dports/devel/libut/files/loop.c.patch
    trunk/dports/devel/libut/files/mem.c.patch
    trunk/dports/devel/libut/files/mem_shl.c.patch
    trunk/dports/devel/libut/files/memperf.c.patch
    trunk/dports/devel/libut/files/mlperf.c.patch
    trunk/dports/devel/libut/files/prf_shl.c.patch
    trunk/dports/devel/libut/files/request.c.patch
    trunk/dports/devel/libut/files/rqst.c.patch
    trunk/dports/devel/libut/files/shl.c.patch
    trunk/dports/devel/libut/files/srvr.c.patch
    trunk/dports/devel/libut/files/timer.c.patch
    trunk/dports/devel/libut/files/tmr.c.patch
    trunk/dports/devel/libut/files/upld.c.patch
    trunk/dports/devel/libut/files/var.c.patch
    trunk/dports/devel/libut/files/var_shl.c.patch

Modified: trunk/dports/devel/libut/Portfile
===================================================================
--- trunk/dports/devel/libut/Portfile	2013-09-23 14:16:53 UTC (rev 111463)
+++ trunk/dports/devel/libut/Portfile	2013-09-23 14:42:42 UTC (rev 111464)
@@ -24,8 +24,36 @@
 
 use_bzip2           yes
 
-# misuse of AC_TRY_LINK produces broken code
-patchfiles          configure.patch
+# configure.patch: misuse of AC_TRY_LINK produces broken code
+# others: function return type bugs and missing includes/prototypes
+patchfiles          configure.patch \
+                    connect.c.patch \
+                    fd.c.patch \
+                    hash.h.patch \
+                    init.c.patch \
+                    iob.c.patch \
+                    listen.c.patch \
+                    log.c.patch \
+                    log_shl.c.patch \
+                    mem.c.patch \
+                    mem_shl.c.patch \
+                    prf_shl.c.patch \
+                    request.c.patch \
+                    shl.c.patch \
+                    loop.c.patch \
+                    tmr.c.patch \
+                    var.c.patch \
+                    var_shl.c.patch \
+                    coproc.c.patch \
+                    coproc_shl.c.patch \
+                    memperf.c.patch \
+                    mlperf.c.patch \
+                    coprocess.c.patch \
+                    rqst.c.patch \
+                    upld.c.patch \
+                    srvr.c.patch \
+                    int.c.patch \
+                    timer.c.patch
 
 configure.args      --mandir=${prefix}/share/man
 

Added: trunk/dports/devel/libut/files/connect.c.patch
===================================================================
--- trunk/dports/devel/libut/files/connect.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/connect.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,18 @@
+--- src/connect.c.orig	2005-11-07 12:45:58.000000000 +1100
++++ src/connect.c	2013-09-23 18:45:35.000000000 +1000
+@@ -44,6 +44,7 @@ static const char id[]="$Id: connect.c,v
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <stdarg.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include "libut/ut_internal.h"
+ 
+@@ -91,6 +92,7 @@ int UT_nb_connect_cb(int fd, char *name,
+     }
+ 
+     UT_mem_free( CBDATA, cbdata, 1);
++    return 0;
+ }
+ 
+ /*******************************************************************************

Added: trunk/dports/devel/libut/files/coproc.c.patch
===================================================================
--- trunk/dports/devel/libut/files/coproc.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/coproc.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,10 @@
+--- src/coproc.c.orig	2005-10-21 11:59:44.000000000 +1000
++++ src/coproc.c	2013-09-23 23:50:19.000000000 +1000
+@@ -127,6 +127,7 @@ int UT_coproc_logger(int fd, char*name, 
+     if (UT_coproc_cleanup(cleaner,0,pid_in) >= 0) 
+         UT_tmr_set(cleaner,COPROC_WAITPID_INTERVAL,UT_coproc_cleanup,pid_in);
+   }
++  return 0;
+ }
+ 
+ /*******************************************************************************

Added: trunk/dports/devel/libut/files/coproc_shl.c.patch
===================================================================
--- trunk/dports/devel/libut/files/coproc_shl.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/coproc_shl.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,10 @@
+--- src/coproc_shl.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/coproc_shl.c	2013-09-23 23:51:23.000000000 +1000
+@@ -71,6 +71,7 @@ int UT_cops_shlcmd( int argc, char *argv
+ int UT_cops_show_usage(int argc,char*argv[]) {
+         UT_shlf("Usage:\n");
+         UT_shlf("cops                      -- view coprocesses\n");
++        return 0;
+ }
+ 
+ 

Added: trunk/dports/devel/libut/files/coprocess.c.patch
===================================================================
--- trunk/dports/devel/libut/files/coprocess.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/coprocess.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,16 @@
+--- tests/coproc/coprocess.c.orig	2005-11-10 17:40:15.000000000 +1100
++++ tests/coproc/coprocess.c	2013-09-24 00:14:47.000000000 +1000
+@@ -17,6 +17,7 @@ int childFcn(char*name,void*data) {
+ 
+ int exHdlr(pid_t pid, int sts, char*name, void*data) {
+     UT_LOG(Info,"coproc %s (%d) exited with sts %d", name,pid,sts);
++    return 0;
+ }
+ 
+ int run_test_cmd(int argc, char *argv[] ) {
+@@ -39,4 +40,5 @@ int main(int argc, char **argv) {
+ 	UT_init(INIT_END);
+     UT_shl_cmd_create("run-test", "fork [n] test coprocesses", run_test_cmd, NULL);
+ 	UT_event_loop();
++	return 0;
+ }

Added: trunk/dports/devel/libut/files/fd.c.patch
===================================================================
--- trunk/dports/devel/libut/files/fd.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/fd.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,10 @@
+--- src/fd.c.orig	2005-11-07 12:45:58.000000000 +1100
++++ src/fd.c	2013-09-23 18:48:38.000000000 +1000
+@@ -165,6 +165,7 @@ int UT_fd_init() {
+     UT_mem_pool_create( FD_POOL, sizeof(UT_fd), 10 );
+     UT_shl_cmd_create( "fds", "list selected file descriptors", 
+             (UT_shlcmd *)UT_fds_shlcmd, NULL);
++    return 0;
+ }
+ 
+ /*******************************************************************************

Added: trunk/dports/devel/libut/files/hash.h.patch
===================================================================
--- trunk/dports/devel/libut/files/hash.h.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/hash.h.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,18 @@
+--- src/libut/hash.h.orig	2005-11-10 18:19:38.000000000 +1100
++++ src/libut/hash.h	2013-09-24 00:08:33.000000000 +1000
+@@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
+ * The number of buckets in the hash is dynamically expanded as necessary to    *
+ * attempt to keep all buckets from having more than 10 elements.               *
+ *******************************************************************************/
++#include <stdlib.h>
+ #include <string.h> /* memcmp,strlen */
+ #include "libut/ut.h"
+ 
+@@ -230,5 +231,7 @@ typedef struct UT_hash_handle {
+    int keylen;  /* enclosing struct's key len, used when rebucketing */
+ } UT_hash_handle;
+ 
++int UT_hash_rescale(UT_hash_table *);
++
+ #endif /* UTHSH_H */
+ 

Added: trunk/dports/devel/libut/files/init.c.patch
===================================================================
--- trunk/dports/devel/libut/files/init.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/init.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,33 @@
+--- src/init.c.orig	2005-11-07 13:05:26.000000000 +1100
++++ src/init.c	2013-09-23 18:57:06.000000000 +1000
+@@ -37,6 +37,7 @@ static const char id[]="$Id: init.c,v 1.
+ #include <time.h>
+ #include <stdarg.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -132,6 +133,13 @@ UT_API int UT_signal_reg( UT_signal_cb* 
+     return 0;
+ }
+ 
++int UT_var_init(void);
++int UT_fd_init();
++int UT_net_listen_init();
++void UT_prf_init();
++int UT_iob_init();
++void UT_net_request_init();
++
+ /******************************************************************************
+  * UT_init()                                                                  *
+  * Application must call this prior to any other UT functions.                *
+@@ -288,6 +296,8 @@ int UT_API UT_init(int opt1, ...) {
+     return 0;
+ }
+ 
++int UT_shl_eval_file(char *filename);
++
+ /*******************************************************************************
+ * UT_first_loop_cb()                                                           *
+ * This is an initialization callback that's invoked on the very first UT loop. *

Added: trunk/dports/devel/libut/files/int.c.patch
===================================================================
--- trunk/dports/devel/libut/files/int.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/int.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,21 @@
+--- tests/hash/int.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ tests/hash/int.c	2013-09-24 00:27:41.000000000 +1000
+@@ -1,3 +1,4 @@
++#include <stdio.h>
+ #include <stdlib.h>
+ #include "libut/ut.h"
+ 
+@@ -40,6 +41,7 @@ int runtest_cmd(int argc, char *argv[]) 
+ 
+ int usage_cb(int argc, char*argv[]) {
+     UT_shlf("usage: runtest [num]  -- run 100 (or num) iterations of test\n");
++    return 0;
+ }
+ 
+ int main() {
+@@ -47,4 +49,5 @@ int main() {
+     UT_shl_cmd_create("runtest", "run a round of testing", runtest_cmd, usage_cb);
+     UT_mem_pool_create("testpool", sizeof(test_t), 10);
+     UT_event_loop();
++    return 0;
+ }

Added: trunk/dports/devel/libut/files/iob.c.patch
===================================================================
--- trunk/dports/devel/libut/files/iob.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/iob.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,8 @@
+--- src/iob.c.orig	2005-11-07 15:08:34.000000000 +1100
++++ src/iob.c	2013-09-23 18:58:38.000000000 +1000
+@@ -238,4 +238,5 @@ char *UT_iob_flatten( UT_iob *iob, size_
+ 
+ int UT_iob_init() {
+     UT_mem_pool_create( UTIOB,  sizeof(UT_iob), 10 );
++    return 0;
+ }

Added: trunk/dports/devel/libut/files/listen.c.patch
===================================================================
--- trunk/dports/devel/libut/files/listen.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/listen.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,27 @@
+--- src/listen.c.orig	2005-10-23 15:31:46.000000000 +1000
++++ src/listen.c	2013-09-23 22:29:29.000000000 +1000
+@@ -44,6 +44,7 @@ static const char id[]="$Id: listen.c,v 
+ #include <netdb.h>
+ #include <arpa/inet.h>
+ #include <string.h>
++#include <stdio.h>
+ #include "libut/ut_internal.h"
+ 
+ extern UT_loop_global_type UT_loop_global;
+@@ -107,7 +108,7 @@ int UT_accept_cb( int fd, char *name, in
+     memset(&sockaddr,0,len);
+     if ( (fd2 = accept(fd, (struct sockaddr*)&sockaddr, &len)) == -1) {
+         UT_LOG(Error, "Socket accept failed: %s", strerror(errno));
+-        return;  
++        return -1;  
+     }
+ 
+     /* Use non-blocking I/O. */
+@@ -131,6 +132,7 @@ int UT_accept_cb( int fd, char *name, in
+     /* Notify application of the new connection by invoking the callback. */
+     flags4 = flags3 | UTFD_IS_NEWACCEPT;
+     (cbdata->cb.fdcb)(fd2, name, flags4, cbdata->data);
++    return 0;
+ }
+ 
+ /*******************************************************************************

Added: trunk/dports/devel/libut/files/log.c.patch
===================================================================
--- trunk/dports/devel/libut/files/log.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/log.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,10 @@
+--- src/log.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/log.c	2013-09-23 22:35:53.000000000 +1000
+@@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
+ #include <stdarg.h>
+ #include <unistd.h>
+ #include <limits.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include <sys/time.h>
+ #include <time.h>

Added: trunk/dports/devel/libut/files/log_shl.c.patch
===================================================================
--- trunk/dports/devel/libut/files/log_shl.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/log_shl.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,89 @@
+--- src/log_shl.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/log_shl.c	2013-09-23 22:49:04.000000000 +1000
+@@ -48,19 +48,20 @@ int UT_log_msg_shl(int argc, char *argv[
+ 
+     if (argc != 2) {
+         UT_shlf("usage: log %s log_message", argv[0]);
+-        return;
++        return -1;
+     }
+     
+     /* Convert the log level string to numeric value and write log message */
+     for (i=0; (p = UT_loglevel_strs[i]) != NULL; i++) {
+         if (!strcmp( p, argv[0] )) {
+             UT_LOG( i, argv[1] );
+-            return;
++            return 0;
+         }
+     }
+ 
+     UT_shlf("Unsupported log level '%s'", argv[0]);
+     UT_LOG( Error, "Invalid log level '%s'; %s", argv[0], argv[1]);
++    return -1;
+ }
+ 
+ /******************************************************************************
+@@ -74,17 +75,17 @@ int UT_log_bump_level (int argc, char*ar
+     if (!strcmp(argv[0], "level")) {
+         if (argc != 2) {
+             UT_shlf("usage: log level <newlevel>");
+-            return;
++            return -1;
+         }
+ 
+         UT_var_set( LOGLEVEL_VARNAME, argv[1]);
+-        return;
++        return 0;
+     }
+ 
+     /* Handle "log more" or "log less" */
+     if (argc != 1) {
+         UT_shlf("usage:\nlog more\nlog less\n");
+-        return;
++        return -1;
+     }
+ 
+     if (!strcmp("more",argv[0]) && (UT_log_global.loglevel < Debugk)) 
+@@ -94,12 +95,13 @@ int UT_log_bump_level (int argc, char*ar
+     else {
+         UT_shlf("Log level already at %s verbosity", 
+                 UT_log_global.loglevel ? "maximum" : "minimum");
+-        return;
++        return -1;
+     }
+ 
+     /* Set it to its new text value, e.g. Info */
+     UT_var_set( LOGLEVEL_VARNAME, UT_loglevel_strs[ new_level ] );
+     UT_shlf( "Now logging at %s level", UT_loglevel_strs[UT_log_global.loglevel]);
++    return 0;
+ }
+ 
+ /******************************************************************************
+@@ -114,16 +116,17 @@ int UT_log_reopen(int argc, char *argv[]
+     if (argc == 1) {
+         UT_var_get( LOGFILE_VARNAME, &file);
+         UT_shlf("%s\n", file);
+-        return;
++        return 0;
+     }
+ 
+     if (argc > 2) {
+         UT_shlf("Usage: log file [newfile]");
+-        return;
++        return -1;
+     }
+ 
+     /* No feedback to shl if user points log file at unopenable path */
+     if (argc == 2) UT_var_set( LOGFILE_VARNAME , argv[1]);
++    return 0;
+ }
+ 
+ /******************************************************************************
+@@ -168,6 +171,7 @@ int UT_log_usage(int argc,char*argv[]) {
+         UT_shlf("log level <newlevel>  -- Change to specified log level\n");
+         UT_shlf("log more              -- Increase logging verbosity\n");
+         UT_shlf("log less              -- Decrease logging verbosity\n");
++        return SHL_OK;
+ }
+ 
+ int UT_log_init_shl() {

Added: trunk/dports/devel/libut/files/loop.c.patch
===================================================================
--- trunk/dports/devel/libut/files/loop.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/loop.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,25 @@
+--- src/loop.c.orig	2005-10-24 07:12:36.000000000 +1000
++++ src/loop.c	2013-09-23 23:36:32.000000000 +1000
+@@ -103,6 +103,9 @@ struct timeval UT_figure_select_timeout(
+     return tv;
+ }
+ 
++int UT_invoke_per_loop_cbs();
++int UT_signal_update();
++
+ /******************************************************************************
+  * UT_event_once()                                                       *
+  * This function is one of the most important in libut. It executes one "loop"*
+@@ -215,10 +218,12 @@ int UT_invoke_per_loop_cbs() {
+ 
+     /* Free the copies we've made.*/
+     UT_mem_free(PER_LOOP_CB_POOL, pscb_tmp, i);
++    return 0;
+ }
+ 
+ int UT_loop_init() {
+     UT_mem_pool_create(PER_LOOP_CB_POOL, sizeof(UT_per_loop_cb_t), 2);
++    return 0;
+ }
+ 
+ /******************************************************************************

Added: trunk/dports/devel/libut/files/mem.c.patch
===================================================================
--- trunk/dports/devel/libut/files/mem.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/mem.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,10 @@
+--- src/mem.c.orig	2005-11-07 12:45:58.000000000 +1100
++++ src/mem.c	2013-09-23 22:56:24.000000000 +1000
+@@ -203,6 +203,7 @@ int UT_update_max_extent( UT_mem_pool *p
+         row->next = pool->rows[new_bkt];
+         pool->rows[new_bkt] = row;
+     }
++    return 0;
+ }
+ 
+ 

Added: trunk/dports/devel/libut/files/mem_shl.c.patch
===================================================================
--- trunk/dports/devel/libut/files/mem_shl.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/mem_shl.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,38 @@
+--- src/mem_shl.c.orig	2005-11-09 16:43:31.000000000 +1100
++++ src/mem_shl.c	2013-09-23 23:14:22.000000000 +1000
+@@ -28,6 +28,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
++#include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "libut/ut_internal.h"
+ 
+@@ -39,6 +41,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
+ *******************************************************************************/
+ extern UT_mem_global_type UT_mem_global;
+ 
++int UT_hash_dump();
++int UT_hash_shlcmd(int argc, char *argv[]);
++int UT_mem_usage(int argc, char *argv[]);
+ 
+ int UT_mem_shlcmd(   int argc, char *argv[]) {
+     UT_mem_pool *pool;
+@@ -149,7 +154,7 @@ int UT_mem_shlcmd(   int argc, char *arg
+     case 3:
+             
+             if (strcmp(argv[1],"-d") != 0) {
+-                    UT_mem_usage(NULL);
++                    UT_mem_usage(0,NULL);
+                     return SHL_OK;
+             }
+ 
+@@ -191,6 +196,7 @@ int UT_mem_usage(int argc,char*argv[]) {
+     UT_shlf("mem -d poolname  --   detailed info on a pool\n");
+     UT_shlf("mem -h           --   display #items/bucket histogram for each hash\n");
+     UT_shlf("mem -H           --   ascii/hex dump of each hash by bucket\n");
++    return 0;
+ }
+ 
+ /*******************************************************************************

Added: trunk/dports/devel/libut/files/memperf.c.patch
===================================================================
--- trunk/dports/devel/libut/files/memperf.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/memperf.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,8 @@
+--- tests/perf/memperf.c.orig	2005-10-21 11:59:44.000000000 +1000
++++ tests/perf/memperf.c	2013-09-23 23:59:35.000000000 +1000
+@@ -1,4 +1,5 @@
+ #include "libut/ut.h"
++#include <stdio.h>
+ #include <stdlib.h>
+ 
+ #define MEM_TMR_INTERVAL 250

Added: trunk/dports/devel/libut/files/mlperf.c.patch
===================================================================
--- trunk/dports/devel/libut/files/mlperf.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/mlperf.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,7 @@
+--- tests/perf/mlperf.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ tests/perf/mlperf.c	2013-09-24 00:11:42.000000000 +1000
+@@ -1,3 +1,4 @@
++#include <stdio.h>
+ #include <stdlib.h> 
+ #include "libut/ut.h"
+ 

Added: trunk/dports/devel/libut/files/prf_shl.c.patch
===================================================================
--- trunk/dports/devel/libut/files/prf_shl.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/prf_shl.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,56 @@
+--- src/prf_shl.c.orig	2005-11-07 13:18:43.000000000 +1100
++++ src/prf_shl.c	2013-09-23 23:24:19.000000000 +1000
+@@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
+ * prf_shl.c                                                                    *
+ * Copyright (c) 2003-2005 Troy Hanson                                          *
+ *******************************************************************************/
++#include <stdio.h>
+ #include "libut/ut_internal.h"
+ 
+ 
+@@ -68,6 +69,11 @@ struct hdrmap {
+ } hdrtbl[] = { PRF_SCALES {-1,NULL} };
+ #undef EL
+ 
++int UT_prf_show_all();
++int UT_prf_show_prf(char *prfname);
++int UT_prf_rescale_shlcmd(char *prf_name, char *new_scale);
++int UT_prf_show_usage(int argc, char *argv[]);
++
+ /******************************************************************************
+  * UT_prf_shlcmd()                                                            *
+  * Impleementation of the shl "prf" command                                   *
+@@ -109,6 +115,7 @@ int UT_prf_show_usage(int argc,char*argv
+         UT_shlf("prf <prf>                 -- view <prf>\n");
+         UT_shlf("prf scale                 -- list scales\n");
+         UT_shlf("prf scale <prf> <scale>   -- rescale <prf>\n");
++        return 0;
+ }
+ 
+ 
+@@ -131,6 +138,8 @@ int UT_prf_show_all() {
+     return 0;
+ }
+ 
++int UT_prf_fmt_prfrow(UT_prf *prf, UT_prf_row *row, char *hdrs[]);
++
+ /******************************************************************************
+  * UT_prf_show_prf()                                                          *
+  * Display the prf header and the prf itself                                  *
+@@ -152,7 +161,7 @@ int UT_prf_show_prf( char *prfname ) {
+     while (map->type != -1 && map->type != prf->scale_type) map++;
+     if (map->type == -1) {
+             UT_LOG(Error, "Unknown prf scale %d", prf->scale_type);
+-            return;
++            return 0;
+     }
+     cols = map->hdr;
+     
+@@ -198,6 +207,7 @@ int UT_prf_fmt_prfrow( UT_prf *prf, UT_p
+     }
+ 
+     UT_shlf("\n");
++    return 0;
+ }
+ 
+ /******************************************************************************

Added: trunk/dports/devel/libut/files/request.c.patch
===================================================================
--- trunk/dports/devel/libut/files/request.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/request.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,49 @@
+--- src/request.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/request.c	2013-09-23 23:21:40.000000000 +1000
+@@ -53,7 +53,7 @@ int UT_net_request_post_cb(int fd, char 
+     if (flags & UTFD_IS_CONFAILURE) {
+         (rqst->cb)(name, rqst->data, (flags|UTFD_IS_REQFAILURE), rqst->io);
+         UT_mem_free( UTRQST, rqst, 1);
+-        return;
++        return -1;
+     } 
+ 
+     reply_wanted = (rqst->io[1] != NULL) ? 1 : 0;
+@@ -70,7 +70,7 @@ int UT_net_request_post_cb(int fd, char 
+             UT_fd_cntl(fd, UTFD_SET_FLAGS, f);
+         }
+         UT_iob_writefd( rqst->io[0], fd);    /* send out the request */
+-        if (reply_wanted) return;            /* reply wanted, wait for it*/
++        if (reply_wanted) return 0;            /* reply wanted, wait for it*/
+         /* Here if requester doesn't want the reply. Finish up below. */
+     } else {
+         /* Socket is readable, meaning the remote host has started to reply. */
+@@ -80,7 +80,7 @@ int UT_net_request_post_cb(int fd, char 
+ 
+         /* Either n=0 (socket closed) or n=-1 (read error or EWOULDBLOCK).   */
+         if (n == -1)  {
+-            if (errno == EAGAIN) return; /* not an error; get more later*/
++            if (errno == EAGAIN) return 0; /* not an error; get more later*/
+             else UT_LOG(Error, "read error %s", strerror(errno));
+         }
+     }
+@@ -93,8 +93,11 @@ int UT_net_request_post_cb(int fd, char 
+         UT_fd_unreg(fd);
+         close(fd);
+     }
++    return 0;
+ }
+ 
++int UT_net_connect2(char *name, UT_fd_cb *cb, void *data, int flags, va_list ap);
++
+ /******************************************************************************
+  * UT_net_request()                                                           *
+  * Initiate a request-response network communication over a transient socket. *
+@@ -121,6 +124,6 @@ UT_API int UT_net_request( char *name, U
+     return rc;
+ }
+ 
+-UT_net_request_init() {
++void UT_net_request_init() {
+     UT_mem_pool_create( UTRQST, sizeof(UT_net_request_type), 10 );
+ }

Added: trunk/dports/devel/libut/files/rqst.c.patch
===================================================================
--- trunk/dports/devel/libut/files/rqst.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/rqst.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,32 @@
+--- tests/rqst/rqst.c.orig	2005-10-25 14:52:06.000000000 +1000
++++ tests/rqst/rqst.c	2013-09-24 00:21:54.000000000 +1000
+@@ -1,5 +1,6 @@
+ #include "libut/ut.h"
+     #include <time.h>
++    #include <stdio.h>
+ 
+ int wget_done_cb(char *name, void *data, int flags, UT_iob *io[2]) {
+     char *out;
+@@ -7,7 +8,7 @@ int wget_done_cb(char *name, void *data,
+ 
+     if (flags & UTFD_IS_REQFAILURE) {
+         UT_LOG(Error, "wget failed");
+-        return;
++        return -1;
+     }
+ 
+     /* we always expect REQUESTFIN since there was no REQFALURE */
+@@ -21,6 +22,7 @@ int wget_done_cb(char *name, void *data,
+     /* the iobs are our responsibility to free */
+     UT_iob_free(io[0]);
+     UT_iob_free(io[1]);
++    return 0;
+ }
+ 
+ int wget_test_cmd(int argc, char *argv[] ) {
+@@ -66,4 +68,5 @@ int main(int argc, char **argv) {
+     UT_shl_cmd_create("wget", "test http get to host", wget_test_cmd, NULL);
+     UT_shl_cmd_create("ascii", "show a-z ascii values", ascii_cmd, NULL);
+ 	UT_event_loop();
++	return 0;
+ }

Added: trunk/dports/devel/libut/files/shl.c.patch
===================================================================
--- trunk/dports/devel/libut/files/shl.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/shl.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,51 @@
+--- src/shl.c.orig	2005-11-09 16:43:31.000000000 +1100
++++ src/shl.c	2013-09-23 23:31:54.000000000 +1000
+@@ -36,6 +36,7 @@ static const char id[]="$Id: shl.c,v 1.2
+ #include <string.h>
+ #include <errno.h>
+ #include <stdarg.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/mman.h>
+@@ -456,7 +457,7 @@ int UT_shl_port_cb(int fd, char *name, i
+             if (fcntl(fd,F_SETFD,fg) == -1) UT_LOG(Error,"fcntl setfd failed");
+         } else UT_LOG(Error, "fcntl getfd failed");
+ 
+-        return;
++        return 0;
+     }
+ 
+     LL_FIND_BY_MEMBER(UT_shl_global.sessions,session,fd,fd);
+@@ -475,7 +476,7 @@ int UT_shl_port_cb(int fd, char *name, i
+ 
+     in = session->in;
+ 
+-    if (rc == -1 && errno == EINTR) return;
++    if (rc == -1 && errno == EINTR) return 0;
+     else if (rc == -1) errsts = strerror(errno);
+     else if (rc == 0) errsts = "remote close";
+     else if (UT_iob_len(in) + rc >= SHL_PORT_MAX_INPUT) errsts = "flooded";
+@@ -483,12 +484,12 @@ int UT_shl_port_cb(int fd, char *name, i
+     if (errsts) {
+         UT_LOG(Info,"shl port connection closed (%s)", errsts);
+         UT_shl_close_session(session);
+-        return;
++        return -1;
+     }
+ 
+     if (!found_eol) {
+         UT_iob_append(in,input,rc);
+-        return;
++        return 0;
+     }
+ 
+     /* Concatenate buffer with current input, if needed. */
+@@ -523,6 +524,7 @@ int UT_shl_port_cb(int fd, char *name, i
+     } 
+ 
+     if (cmdtxt) free(cmdtxt);
++    return 0;
+ }
+ 
+ /*******************************************************************************

Added: trunk/dports/devel/libut/files/srvr.c.patch
===================================================================
--- trunk/dports/devel/libut/files/srvr.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/srvr.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,21 @@
+--- tests/rqst/srvr.c.orig	2005-10-23 13:36:45.000000000 +1000
++++ tests/rqst/srvr.c	2013-09-24 00:25:45.000000000 +1000
+@@ -29,10 +29,12 @@ int srvr_cb(int fd, char *name, int flag
+         UT_fd_unreg(fd);
+         close(fd);
+     }
++    return 0;
+ }
+ 
+ int sig_cb(int signum) {
+     UT_LOG(Info,"srvr got signal %d", signum);
++    return 0;
+ }
+ 
+ int main(int argc, char **argv) {
+@@ -41,4 +43,5 @@ int main(int argc, char **argv) {
+     UT_signal_reg( sig_cb );
+     UT_net_listen("srvr", "*:2222", (UT_fd_cb*)srvr_cb, NULL);
+     UT_event_loop();
++    return 0;
+ }

Added: trunk/dports/devel/libut/files/timer.c.patch
===================================================================
--- trunk/dports/devel/libut/files/timer.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/timer.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,26 @@
+--- tests/tmr/timer.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ tests/tmr/timer.c	2013-09-24 00:32:32.000000000 +1000
+@@ -1,3 +1,4 @@
++#include <stdio.h>
+ #include <stdlib.h>
+ #include "libut/ut.h"
+ 
+@@ -8,10 +9,12 @@ int tmrtest_cb(char *name, unsigned msec
+ 
+ int tmradd_usage(int argc,char*argv[]) {
+     UT_shlf("usage: tmradd <timername> <msec>\n");
++    return 0;
+ }
+ 
+ int tmrdel_usage(int argc,char*argv[]) {
+     UT_shlf("usage: tmrdel <timername>\n");
++    return 0;
+ }
+ 
+ int tmradd_cmd(int argc, char *argv[]) {
+@@ -44,4 +47,5 @@ int main() {
+     UT_shl_cmd_create( "tmradd", "add a timer", tmradd_cmd, tmradd_usage);
+     UT_shl_cmd_create( "tmrdel", "delete a timer", tmrdel_cmd, tmrdel_usage);
+     UT_event_loop();
++    return 0;
+ }

Added: trunk/dports/devel/libut/files/tmr.c.patch
===================================================================
--- trunk/dports/devel/libut/files/tmr.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/tmr.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,27 @@
+--- src/tmr.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/tmr.c	2013-09-24 00:37:54.000000000 +1000
+@@ -105,8 +105,8 @@ int UT_tmr_update() {
+     int rc;
+ 
+     /* Anything to do? Check for (a) no timers; or (b) no expired timers */
+-    if (!UT_loop_global.tmr_first) return;              
+-    if (timercmp(&UT_loop_global.TOD, UT_loop_global.tmr_first, <)) return; 
++    if (!UT_loop_global.tmr_first) return 0;              
++    if (timercmp(&UT_loop_global.TOD, UT_loop_global.tmr_first, <)) return 0; 
+ 
+     /* One or more timers have expired. Unlink their respective structs
+      * from the timers list and link them into an expired list. Then we 
+@@ -160,6 +160,7 @@ int UT_tmr_update() {
+         tmr = tmr_nxt;
+     }
+     UT_prf_end( "libut", "timer_callbacks");
++    return 0;
+ }
+ 
+ UT_API int UT_tmr_clear(char *name) {
+@@ -238,4 +239,5 @@ int UT_tmr_init() {
+             NULL);
+     UT_shl_cmd_create( "uptime", "show uptime", (UT_shlcmd *)UT_uptime_shlcmd,
+             NULL);
++    return 0;
+ }

Added: trunk/dports/devel/libut/files/upld.c.patch
===================================================================
--- trunk/dports/devel/libut/files/upld.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/upld.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,25 @@
+--- tests/rqst/upld.c.orig	2005-10-25 14:52:06.000000000 +1000
++++ tests/rqst/upld.c	2013-09-24 00:20:30.000000000 +1000
+@@ -16,7 +16,7 @@ int upld_done_cb(char *name, void *data,
+ 
+     if (flags & UTFD_IS_REQFAILURE) {
+         UT_LOG(Error, "upld failed");
+-        return;
++        return -1;
+     }
+ 
+     /* can assume REQSUCCESS since we did not have REQFALURE */
+@@ -24,6 +24,7 @@ int upld_done_cb(char *name, void *data,
+ 
+     /* the iobs are our responsibility to free */
+     UT_iob_free(io[0]);
++    return 0;
+ }
+ 
+ UT_iob *file_to_iob(char *filename) {
+@@ -110,4 +111,5 @@ int main(int argc, char **argv) {
+     UT_shl_cmd_create("upld", "upload <file> to <host> <port>",upld_test_cmd,NULL);
+     UT_shl_cmd_create("dns", "translate host:port to ip:port", dns_test_cmd, NULL);
+ 	UT_event_loop();
++	return 0;
+ }

Added: trunk/dports/devel/libut/files/var.c.patch
===================================================================
--- trunk/dports/devel/libut/files/var.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/var.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,24 @@
+--- src/var.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/var.c	2013-09-23 23:46:28.000000000 +1000
+@@ -45,11 +45,13 @@ UT_var_global_type UT_var_global = { 
+     .vars  = NULL
+ };
+ 
++void UT_var_shl_init();
+ 
+ int UT_var_init(void) {
+     UT_mem_pool_create( UTSHL_VARS, sizeof(UT_var), 10);
+     UT_mem_pool_create( CBDATA, sizeof(UT_callback), 10 );
+     UT_var_shl_init();
++    return 0;
+ }
+ 
+ UT_API int UT_var_create(char *name, char *desc, UT_var_type type, ...) {
+@@ -174,6 +176,7 @@ int UT_var_set_cvar(UT_var *var) {
+             UT_LOG(Fatal, "Unknown var type %d", var->type);
+             break;
+     }
++    return 0;
+ }
+ 
+ UT_API int UT_var_get(char *name, void *val) {

Added: trunk/dports/devel/libut/files/var_shl.c.patch
===================================================================
--- trunk/dports/devel/libut/files/var_shl.c.patch	                        (rev 0)
+++ trunk/dports/devel/libut/files/var_shl.c.patch	2013-09-23 14:42:42 UTC (rev 111464)
@@ -0,0 +1,18 @@
+--- src/var_shl.c.orig	2005-10-24 11:40:32.000000000 +1000
++++ src/var_shl.c	2013-09-23 23:48:22.000000000 +1000
+@@ -28,6 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
++#include <stdio.h>
+ #include <string.h>
+ #include "libut/ut_internal.h"
+ 
+@@ -182,6 +183,7 @@ int UT_var_usage(int argc,char*argv[]) {
+     UT_shlf(" var                    -- show all vars\n");
+     UT_shlf(" var varname            -- show named var\n");
+     UT_shlf(" var varname [=] newval -- set var to new value\n");
++    return 0;
+ }
+ 
+ void UT_var_shl_init() {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130923/5fbe603b/attachment-0001.html>


More information about the macports-changes mailing list