Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/isdn/isdnd Shuffle a bit to allow some compilers to...



details:   https://anonhg.NetBSD.org/src/rev/b85604635120
branches:  trunk
changeset: 546583:b85604635120
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri May 02 04:29:03 2003 +0000

description:
Shuffle a bit to allow some compilers to optimize symbol references
more effectively.

>From Ian Lance Taylor.

diffstat:

 usr.sbin/isdn/isdnd/pcause.c |  67 +++++++++++++++++++++----------------------
 1 files changed, 32 insertions(+), 35 deletions(-)

diffs (89 lines):

diff -r 680a2c10e27d -r b85604635120 usr.sbin/isdn/isdnd/pcause.c
--- a/usr.sbin/isdn/isdnd/pcause.c      Fri May 02 03:26:11 2003 +0000
+++ b/usr.sbin/isdn/isdnd/pcause.c      Fri May 02 04:29:03 2003 +0000
@@ -27,7 +27,7 @@
  *     printing cause values
  *     ---------------------
  *
- *     $Id: pcause.c,v 1.1.1.1 2001/01/06 13:00:23 martin Exp $
+ *     $Id: pcause.c,v 1.2 2003/05/02 04:29:03 thorpej Exp $
  *
  * $FreeBSD$
  *
@@ -37,40 +37,6 @@
 
 #include "isdnd.h"
 
-static char *cause_i4b_tab[CAUSE_I4B_MAX+1];
-static char *cause_q850_tab[CAUSE_Q850_MAX];
-
-char *
-print_i4b_cause(cause_t code)
-{
-       static char error_message[128];
-
-       snprintf(error_message, sizeof(error_message), "%d: ", GET_CAUSE_VAL(code));
-
-       switch(GET_CAUSE_TYPE(code))
-       {
-               case CAUSET_Q850:
-                       strcat(error_message, cause_q850_tab[GET_CAUSE_VAL(code)]);
-                       strcat(error_message, " (Q.850)");
-                       break;
-
-               case CAUSET_I4B:
-                       if((GET_CAUSE_VAL(code) < CAUSE_I4B_NORMAL) ||
-                          (GET_CAUSE_VAL(code) >= CAUSE_I4B_MAX))
-                       {
-                               SET_CAUSE_VAL(code, CAUSE_I4B_MAX);
-                       }
-                       strcat(error_message, cause_i4b_tab[GET_CAUSE_VAL(code)]);
-                       strcat(error_message, " (I4B)");
-                       break;
-
-               default:
-                       strcat(error_message, "ERROR: unknown cause type!");
-                       break;
-       }
-       return(error_message);
-}
-
 static char *cause_i4b_tab[CAUSE_I4B_MAX+1] = {
        "normal call clearing",
        "user busy",
@@ -227,4 +193,35 @@
        "Interworking, unspecified"
 };
 
+char *
+print_i4b_cause(cause_t code)
+{
+       static char error_message[128];
+
+       snprintf(error_message, sizeof(error_message), "%d: ", GET_CAUSE_VAL(code));
+
+       switch(GET_CAUSE_TYPE(code))
+       {
+               case CAUSET_Q850:
+                       strcat(error_message, cause_q850_tab[GET_CAUSE_VAL(code)]);
+                       strcat(error_message, " (Q.850)");
+                       break;
+
+               case CAUSET_I4B:
+                       if((GET_CAUSE_VAL(code) < CAUSE_I4B_NORMAL) ||
+                          (GET_CAUSE_VAL(code) >= CAUSE_I4B_MAX))
+                       {
+                               SET_CAUSE_VAL(code, CAUSE_I4B_MAX);
+                       }
+                       strcat(error_message, cause_i4b_tab[GET_CAUSE_VAL(code)]);
+                       strcat(error_message, " (I4B)");
+                       break;
+
+               default:
+                       strcat(error_message, "ERROR: unknown cause type!");
+                       break;
+       }
+       return(error_message);
+}
+
 /* EOF */



Home | Main Index | Thread Index | Old Index