tree-wide: fix assorted typos all over the place
[safe/jmp/linux-2.6] / drivers / isdn / hardware / eicon / message.c
index f9b00f1..27d5dd6 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  *
   Copyright (c) Eicon Networks, 2002.
@@ -253,7 +252,7 @@ extern APPL   * application;
 
 
 
-static byte remove_started = FALSE;
+static byte remove_started = false;
 static PLCI dummy_plci;
 
 
@@ -456,12 +455,12 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
 
         return _QUEUE_FULL;
       }
-      c = FALSE;
+      c = false;
       if ((((byte   *) msg) < ((byte   *)(plci->msg_in_queue)))
        || (((byte   *) msg) >= ((byte   *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue)))
       {
         if (plci->msg_in_write_pos != plci->msg_in_read_pos)
-          c = TRUE;
+          c = true;
       }
       if (msg->header.command == _DATA_B3_R)
       {
@@ -506,13 +505,13 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
 
             return _QUEUE_FULL;
           }
-          c = TRUE;
+          c = true;
         }
       }
       else
       {
         if (plci->req_in || plci->internal_command)
-          c = TRUE;
+          c = true;
         else
         {
           plci->command = msg->header.command;
@@ -533,7 +532,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
         if (m->header.command == _DATA_B3_R)
         {
 
-          m->info.data_b3_req.Data = (dword)(TransmitBufferSet (appl, m->info.data_b3_req.Data));
+          m->info.data_b3_req.Data = (dword)(long)(TransmitBufferSet (appl, m->info.data_b3_req.Data));
 
         }
 
@@ -552,9 +551,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
   dbug(1,dprintf("com=%x",msg->header.command));
 
   for(j=0;j<MAX_MSG_PARMS+1;j++) msg_parms[j].length = 0;
-  for(i=0, ret = _BAD_MSG;
-      i<(sizeof(ftable)/sizeof(struct _ftable));
-      i++) {
+  for(i=0, ret = _BAD_MSG; i < ARRAY_SIZE(ftable); i++) {
 
     if(ftable[i].command==msg->header.command) {
       /* break loop if the message is correct, otherwise continue scan  */
@@ -593,7 +590,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
 /* api_parse function, check the format of api messages             */
 /*------------------------------------------------------------------*/
 
-word api_parse(byte   * msg, word length, byte * format, API_PARSE * parms)
+static word api_parse(byte *msg, word length, byte *format, API_PARSE *parms)
 {
   word i;
   word p;
@@ -626,13 +623,13 @@ word api_parse(byte   * msg, word length, byte * format, API_PARSE * parms)
       break;
     }
 
-    if(p>length) return TRUE;
+    if(p>length) return true;
   }
   if(parms) parms[i].info = NULL;
-  return FALSE;
+  return false;
 }
 
-void api_save_msg(API_PARSE   *in, byte *format, API_SAVE   *out)
+static void api_save_msg(API_PARSE *in, byte *format, API_SAVE *out)
 {
   word i, j, n = 0;
   byte   *p;
@@ -664,7 +661,7 @@ void api_save_msg(API_PARSE   *in, byte *format, API_SAVE   *out)
   out->parms[i].length = 0;
 }
 
-void api_load_msg(API_SAVE   *in, API_PARSE   *out)
+static void api_load_msg(API_SAVE *in, API_PARSE *out)
 {
   word i;
 
@@ -687,7 +684,7 @@ word api_remove_start(void)
   word j;
 
   if(!remove_started) {
-    remove_started = TRUE;
+    remove_started = true;
     for(i=0;i<max_adapter;i++) {
       if(adapter[i].request) {
         for(j=0;j<adapter[i].max_plci;j++) {
@@ -743,7 +740,7 @@ static void start_internal_command (dword Id, PLCI   *plci, t_std_internal_comma
   else
   {
     i = 1;
-    while (plci->internal_command_queue[i] != 0)
+    while (plci->internal_command_queue[i] != NULL)
       i++;
     plci->internal_command_queue[i] = command_function;
   }
@@ -759,7 +756,7 @@ static void next_internal_command (dword Id, PLCI   *plci)
 
   plci->internal_command = 0;
   plci->internal_command_queue[0] = NULL;
-  while (plci->internal_command_queue[1] != 0)
+  while (plci->internal_command_queue[1] != NULL)
   {
     for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS - 1; i++)
       plci->internal_command_queue[i] = plci->internal_command_queue[i+1];
@@ -1032,7 +1029,7 @@ static void plci_free_msg_in_queue (PLCI   *plci)
       {
 
         TransmitBufferFree (plci->appl,
-          (byte   *)(((CAPI_MSG   *)(&((byte   *)(plci->msg_in_queue))[i]))->info.data_b3_req.Data));
+          (byte *)(long)(((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[i]))->info.data_b3_req.Data));
 
       }
 
@@ -1080,7 +1077,7 @@ static void plci_remove(PLCI   * plci)
       send_req(plci);
     }
   }
-  ncci_remove (plci, 0, FALSE);
+  ncci_remove (plci, 0, false);
   plci_free_msg_in_queue (plci);
 
   plci->channels = 0;
@@ -1195,7 +1192,8 @@ static char hex_digit_table[0x10] =
 /* translation function for each message                            */
 /*------------------------------------------------------------------*/
 
-byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                       PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word ch;
   word i;
@@ -1226,7 +1224,7 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
       Id = ((word)1<<8)|a->Id;
       sendf(appl,_CONNECT_R|CONFIRM,Id,Number,"w",0);
       sendf(appl, _DISCONNECT_I, Id, 0, "w", _L1_ERROR);
-      return FALSE;
+      return false;
     }
     Info = _OUT_OF_PLCI;
     if((i=get_plci(a)))
@@ -1330,7 +1328,7 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
       plci->command = _CONNECT_R;
       plci->number = Number;
       /* x.31 or D-ch free SAPI in LinkLayer? */
-      if(ch==1 && LinkLayer!=3 && LinkLayer!=12) noCh = TRUE;
+      if(ch==1 && LinkLayer!=3 && LinkLayer!=12) noCh = true;
       if((ch==0 || ch==2 || noCh || ch==3 || ch==4) && !Info)
       {
         /* B-channel used for B3 connections (ch==0), or no B channel    */
@@ -1381,7 +1379,7 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             plci->command = 0;
             dbug(1,dprintf("Spoof"));
             send_req(plci);
-            return FALSE;
+            return false;
           }
           if(ch==4)add_p(plci,CHI,p_chi);
           add_s(plci,CPN,&parms[1]);
@@ -1395,11 +1393,11 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             plci->appl = appl;
             sig_req(plci,LISTEN_REQ,0);
             send_req(plci);
-            return FALSE;
+            return false;
           }
         }
         send_req(plci);
-        return FALSE;
+        return false;
       }
       plci->Id = 0;
     }
@@ -1412,7 +1410,8 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
   return 2;
 }
 
-byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                       PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word i, Info;
   word Reject;
@@ -1568,13 +1567,15 @@ byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
   return 1;
 }
 
-byte connect_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte connect_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                         PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   dbug(1,dprintf("connect_a_res"));
-  return FALSE;
+  return false;
 }
 
-byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                          PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   word Info;
   word i;
@@ -1624,12 +1625,13 @@ byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
       }
     }
 
-  if(!appl)  return FALSE;
+  if(!appl)  return false;
   sendf(appl, _DISCONNECT_R|CONFIRM, Id, Number, "w",Info);
-  return FALSE;
+  return false;
 }
 
-byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                          PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   dbug(1,dprintf("disconnect_res"));
   if(plci)
@@ -1656,7 +1658,8 @@ byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
   return 0;
 }
 
-byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                      PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word Info;
   byte i;
@@ -1702,10 +1705,11 @@ byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, A
         "w",Info);
 
   if (a) listen_check(a);
-  return FALSE;
+  return false;
 }
 
-byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                    PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   word i;
   API_PARSE * ai;
@@ -1739,7 +1743,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APP
       add_s(plci,KEY,&ai_parms[1]);
       sig_req(plci,INFO_REQ,0);
       send_req(plci);
-      return FALSE;
+      return false;
     }
 
     if(plci->State && ai_parms[2].length)
@@ -1769,7 +1773,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APP
     if((i=get_plci(a)))
     {
       rc_plci = &a->plci[i-1];
-      appl->NullCREnable  = TRUE;
+      appl->NullCREnable  = true;
       rc_plci->internal_command = C_NCR_FAC_REQ;
       rc_plci->appl = appl;
       add_p(rc_plci,CAI,"\x01\x80");
@@ -1788,7 +1792,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APP
       add_ai(rc_plci, &msg[1]);
       sig_req(rc_plci,NCR_FACILITY,0);
       send_req(rc_plci);
-      return FALSE;
+      return false;
      /* for application controlled supplementary services    */
     }
   }
@@ -1811,16 +1815,18 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APP
           Number,
           "w",Info);
   }
-  return FALSE;
+  return false;
 }
 
-byte info_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte info_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                    PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   dbug(1,dprintf("info_res"));
-  return FALSE;
+  return false;
 }
 
-byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                     PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   word Info;
   byte ret;
@@ -1828,7 +1834,7 @@ byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, AP
   dbug(1,dprintf("alert_req"));
 
   Info = _WRONG_IDENTIFIER;
-  ret = FALSE;
+  ret = false;
   if(plci) {
     Info = _ALERT_IGNORED;
     if(plci->State!=INC_CON_ALERT) {
@@ -1850,7 +1856,8 @@ byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, AP
   return ret;
 }
 
-byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                        PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   word Info = 0;
   word i    = 0;
@@ -1922,7 +1929,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             rplci->appl = appl;
             sig_req(rplci,S_SUPPORTED,0);
             send_req(rplci);
-            return FALSE;
+            return false;
             break;
 
           case S_LISTEN:
@@ -1972,7 +1979,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               add_s(plci,CAI,&ss_parms[1]);
               sig_req(plci,CALL_HOLD,0);
               send_req(plci);
-              return FALSE;
+              return false;
             }
             else Info = 0x3010;                    /* wrong state           */
             break;
@@ -1997,13 +2004,13 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
                 plci->internal_command = BLOCK_PLCI;
                 plci->command = 0;
                 dbug(1,dprintf("Spoof"));
-                return FALSE;
+                return false;
               }
               else
               {
                 sig_req(plci,CALL_RETRIEVE,0);
                 send_req(plci);
-                return FALSE;
+                return false;
               }
             }
             else Info = 0x3010;                    /* wrong state           */
@@ -2123,7 +2130,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               add_p(plci,CAI,cai);
               sig_req(plci,S_SERVICE,0);
               send_req(plci);
-              return FALSE;
+              return false;
             }
             else Info = 0x3010;                    /* wrong state           */
             break;
@@ -2265,7 +2272,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               add_p(rplci,CAI,cai);
               sig_req(rplci,S_SERVICE,0);
               send_req(rplci);
-              return FALSE;
+              return false;
             }
             else
             {
@@ -2291,14 +2298,14 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             ss_parms[3].info[3] = (byte)GET_WORD(&(ss_parms[2].info[0]));
             plci->command = 0;
             plci->internal_command = CD_REQ_PEND;
-            appl->CDEnable = TRUE;
+            appl->CDEnable = true;
             cai[0] = 1;
             cai[1] = CALL_DEFLECTION;
             add_p(plci,CAI,cai);
             add_p(plci,CPN,ss_parms[3].info);
             sig_req(plci,S_SERVICE,0);
             send_req(plci);
-            return FALSE;
+            return false;
             break;
 
           case S_CALL_FORWARDING_START:
@@ -2337,7 +2344,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             add_p(rplci,CPN,ss_parms[6].info);
             sig_req(rplci,S_SERVICE,0);
             send_req(rplci);
-            return FALSE;
+            return false;
             break;
 
           case S_INTERROGATE_DIVERSION:
@@ -2456,7 +2463,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
                         
             sig_req(rplci,S_SERVICE,0);
             send_req(rplci);
-            return FALSE;
+            return false;
             break;
 
           case S_MWI_ACTIVATE:
@@ -2472,7 +2479,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               {
                 rplci = &a->plci[i-1];
                 rplci->appl = appl;
-                rplci->cr_enquiry=TRUE;
+                rplci->cr_enquiry=true;
                 add_p(rplci,CAI,"\x01\x80");
                 add_p(rplci,UID,"\x06\x43\x61\x70\x69\x32\x30");
                 sig_req(rplci,ASSIGN,DSIG_ID);
@@ -2487,7 +2494,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             else
             {
               rplci = plci;
-              rplci->cr_enquiry=FALSE;
+              rplci->cr_enquiry=false;
             }
 
             rplci->command = 0;
@@ -2509,7 +2516,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             add_p(rplci,UID,ss_parms[10].info); /* Time */
             sig_req(rplci,S_SERVICE,0);
             send_req(rplci);
-            return FALSE;
+            return false;
 
           case S_MWI_DEACTIVATE:
             if(api_parse(&parms->info[1],(word)parms->length,"wbwwss",ss_parms))
@@ -2524,7 +2531,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               {
                 rplci = &a->plci[i-1];
                 rplci->appl = appl;
-                rplci->cr_enquiry=TRUE;
+                rplci->cr_enquiry=true;
                 add_p(rplci,CAI,"\x01\x80");
                 add_p(rplci,UID,"\x06\x43\x61\x70\x69\x32\x30");
                 sig_req(rplci,ASSIGN,DSIG_ID);
@@ -2539,7 +2546,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             else
             {
               rplci = plci;
-              rplci->cr_enquiry=FALSE;
+              rplci->cr_enquiry=false;
             }
 
             rplci->command = 0;
@@ -2556,7 +2563,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
             add_p(rplci,OAD,ss_parms[5].info); /* Controlling User Number */
             sig_req(rplci,S_SERVICE,0);
             send_req(rplci);
-            return FALSE;
+            return false;
 
           default:
             Info = 0x300E;  /* not supported */
@@ -2597,16 +2604,18 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
         Id,
         Number,
         "wws",Info,selector,SSparms);
-  return FALSE;
+  return false;
 }
 
-byte facility_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte facility_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                        PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   dbug(1,dprintf("facility_res"));
-  return FALSE;
+  return false;
 }
 
-byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                          PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word Info = 0;
   byte req;
@@ -2649,7 +2658,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
               Id,
               Number,
               "w",Info);
-        return FALSE;
+        return false;
       }
       plci->requested_options_conn = 0;
 
@@ -2684,7 +2693,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
            || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS))
           {
             len = (byte)(&(((T30_INFO *) 0)->universal_6));
-            fax_info_change = FALSE;
+            fax_info_change = false;
             if (ncpi->length >= 4)
             {
               w = GET_WORD(&ncpi->info[3]);
@@ -2693,7 +2702,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
                 ((T30_INFO   *)(plci->fax_connect_info_buffer))->resolution =
                   (byte)((((T30_INFO   *)(plci->fax_connect_info_buffer))->resolution & ~T30_RESOLUTION_R8_0770_OR_200) |
                   ((w & 0x0001) ? T30_RESOLUTION_R8_0770_OR_200 : 0));
-                fax_info_change = TRUE;
+                fax_info_change = true;
               }
               fax_control_bits &= ~(T30_CONTROL_BIT_REQUEST_POLLING | T30_CONTROL_BIT_MORE_DOCUMENTS);
               if (w & 0x0002)  /* Fax-polling request */
@@ -2709,7 +2718,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
                 if (((byte) w) != ((T30_INFO   *)(plci->fax_connect_info_buffer))->data_format)
                 {
                   ((T30_INFO   *)(plci->fax_connect_info_buffer))->data_format = (byte) w;
-                  fax_info_change = TRUE;
+                  fax_info_change = true;
                 }
 
                 if ((a->man_profile.private_options & (1L << PRIVATE_FAX_SUB_SEP_PWD))
@@ -2781,13 +2790,13 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
                 {
                   len = (byte)(&(((T30_INFO *) 0)->universal_6));
                 }
-                fax_info_change = TRUE;
+                fax_info_change = true;
 
               }
               if (fax_control_bits != GET_WORD(&((T30_INFO   *)plci->fax_connect_info_buffer)->control_bits_low))
               {
                 PUT_WORD (&((T30_INFO   *)plci->fax_connect_info_buffer)->control_bits_low, fax_control_bits);
-                fax_info_change = TRUE;
+                fax_info_change = true;
               }
             }
             if (Info == GOOD)
@@ -2798,12 +2807,12 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
                 if (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS)
                 {
                   start_internal_command (Id, plci, fax_connect_info_command);
-                  return FALSE;
+                  return false;
                 }
                 else
                 {
                   start_internal_command (Id, plci, fax_adjust_b23_command);
-                  return FALSE;
+                  return false;
                 }
               }
             }
@@ -2820,7 +2829,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
         for (w = 0; w < ncpi->length; w++)
           plci->internal_req_buffer[2+w] = ncpi->info[1+w];
         start_internal_command (Id, plci, rtp_connect_b3_req_command);
-        return FALSE;
+        return false;
       }
 
       if(!Info)
@@ -2837,10 +2846,11 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
         Id,
         Number,
         "w",Info);
-  return FALSE;
+  return false;
 }
 
-byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                          PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word ncci;
   API_PARSE * ncpi;
@@ -2909,7 +2919,7 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
             plci->fax_connect_info_length = len;
             ((T30_INFO *)(plci->fax_connect_info_buffer))->code = 0;
             start_internal_command (Id, plci, fax_connect_ack_command);
-     return FALSE;
+     return false;
           }
         }
 
@@ -2932,7 +2942,7 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
         for (w = 0; w < ncpi->length; w++)
           plci->internal_req_buffer[2+w] = ncpi->info[1+w];
         start_internal_command (Id, plci, rtp_connect_b3_res_command);
-        return FALSE;
+        return false;
       }
 
       else
@@ -2945,17 +2955,18 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plc
         sendf(appl,_CONNECT_B3_ACTIVE_I,Id,0,"s","");
         if (plci->adjust_b_restore)
         {
-          plci->adjust_b_restore = FALSE;
+          plci->adjust_b_restore = false;
           start_internal_command (Id, plci, adjust_b_restore);
         }
       }
       return 1;
     }
   }
-  return FALSE;
+  return false;
 }
 
-byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                            PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word ncci;
 
@@ -2972,10 +2983,11 @@ byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
       channel_xmit_xon (plci);
     }
   }
-  return FALSE;
+  return false;
 }
 
-byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                             PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word Info;
   word ncci;
@@ -3004,7 +3016,7 @@ byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   *
       {
         plci->send_disc = (byte)ncci;
         plci->command = 0;
-        return FALSE;
+        return false;
       }
       else
       {
@@ -3028,10 +3040,11 @@ byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   *
         Id,
         Number,
         "w",Info);
-  return FALSE;
+  return false;
 }
 
-byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                             PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word ncci;
   word i;
@@ -3084,10 +3097,11 @@ byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   *
       }
     }
   }
-  return FALSE;
+  return false;
 }
 
-byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                       PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   NCCI   *ncci_ptr;
   DATA_B3_DESC   *data;
@@ -3118,7 +3132,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
        && (((byte   *)(parms[0].info)) < ((byte   *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue)))
       {
 
-        data->P = (byte   *)(*((dword   *)(parms[0].info)));
+        data->P = (byte *)(long)(*((dword *)(parms[0].info)));
 
       }
       else
@@ -3140,7 +3154,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
       }
 
       send_data(plci);
-      return FALSE;
+      return false;
     }
   }
   if (appl)
@@ -3151,7 +3165,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
        && (((byte   *)(parms[0].info)) < ((byte   *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue)))
       {
 
-        TransmitBufferFree (appl, (byte   *)(*((dword   *)(parms[0].info))));
+        TransmitBufferFree (appl, (byte *)(long)(*((dword *)(parms[0].info))));
 
       }
     }
@@ -3161,10 +3175,11 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
           Number,
           "ww",GET_WORD(parms[2].info),Info);
   }
-  return FALSE;
+  return false;
 }
 
-byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                       PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word n;
   word ncci;
@@ -3194,10 +3209,11 @@ byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
       }
     }
   }
-  return FALSE;
+  return false;
 }
 
-byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                        PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word Info;
   word ncci;
@@ -3235,10 +3251,11 @@ byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
         Id,
         Number,
         "w",Info);
-  return FALSE;
+  return false;
 }
 
-byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                        PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word ncci;
 
@@ -3254,15 +3271,16 @@ byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
       {
         a->ncci_state[ncci] = CONNECTED;
         nl_req_ncci(plci,N_RESET_ACK,(byte)ncci);
-        return TRUE;
+        return true;
       }
     break;
     }
   }
-  return FALSE;
+  return false;
 }
 
-byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                                PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word ncci;
   API_PARSE * ncpi;
@@ -3292,11 +3310,12 @@ byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI
       return 1;
     }
   }
-  return FALSE;
+  return false;
 }
 
 
-byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                        PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   word Info=0;
   word i;
@@ -3378,7 +3397,7 @@ byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               plci->internal_command = BLOCK_PLCI; /* lock other commands */
               plci->command = 0;
               dbug(1,dprintf("continue if codec loaded"));
-              return FALSE;
+              return false;
             }
           }
         }
@@ -3407,15 +3426,16 @@ byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
         else if (plci->call_dir & CALL_DIR_IN)
           plci->call_dir = CALL_DIR_IN | CALL_DIR_ANSWER;
         start_internal_command (Id, plci, select_b_command);
-        return FALSE;
+        return false;
       }
     }
   }
   sendf(appl, _SELECT_B_REQ|CONFIRM, Id, Number, "w", Info);
-  return FALSE;
+  return false;
 }
 
-byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * parms)
+static byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                            PLCI *plci, APPL *appl, API_PARSE *parms)
 {
   word command;
   word i;
@@ -3489,7 +3509,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
           }
 
           plci->State = LOCAL_CONNECT;
-          plci->manufacturer = TRUE;
+          plci->manufacturer = true;
           plci->command = _MANUFACTURER_R;
           plci->m_command = command;
           plci->number = Number;
@@ -3520,7 +3540,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
                 plci->internal_command = BLOCK_PLCI; /* reject other req meanwhile */
                 plci->command = 0;
                 send_req(plci);
-                return FALSE;
+                return false;
               }
               if(dir==1) {
                 sig_req(plci,CALL_REQ,0);
@@ -3573,7 +3593,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
       }
       else if(req==LAW_REQ)
       {
-        plci->cr_enquiry = TRUE;
+        plci->cr_enquiry = true;
       }
       add_ss(plci,FTY,&m_parms[1]);
       sig_req(plci,req,0);
@@ -3739,11 +3759,12 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
         Id,
         Number,
         "dww",_DI_MANU_ID,command,Info);
-  return FALSE;
+  return false;
 }
 
 
-byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APPL   * appl, API_PARSE * msg)
+static byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
+                            PLCI *plci, APPL *appl, API_PARSE *msg)
 {
   word indication;
 
@@ -3760,7 +3781,7 @@ byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
    || (msg[1].length == 0)
    || (GET_DWORD(msg[0].info)!=_DI_MANU_ID))
   {
-    return FALSE;
+    return false;
   }
   indication = GET_WORD(msg[1].info);
   switch (indication)
@@ -3811,7 +3832,7 @@ byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * p
     break;
 
   }
-  return FALSE;
+  return false;
 }
 
 /*------------------------------------------------------------------*/
@@ -3908,14 +3929,14 @@ void   callback(ENTITY   * e)
           plci->nl_req = 0;
       }
       if (plci->nl_req)
-        control_rc (plci, 0, rc, ch, 0, TRUE);
+        control_rc (plci, 0, rc, ch, 0, true);
       else
       {
         if (req == N_XON)
         {
           channel_x_on (plci, ch);
           if (plci->internal_command)
-            control_rc (plci, req, rc, ch, 0, TRUE);
+            control_rc (plci, req, rc, ch, 0, true);
         }
         else
         {
@@ -3931,21 +3952,21 @@ void   callback(ENTITY   * e)
               }
             }
             channel_xmit_xon (plci);
-            control_rc (plci, 0, rc, ch, global_req, TRUE);
+            control_rc (plci, 0, rc, ch, global_req, true);
           }
           else if (plci->data_sent)
           {
             channel_xmit_xon (plci);
-            plci->data_sent = FALSE;
+            plci->data_sent = false;
             plci->NL.XNum = 1;
             data_rc (plci, ch);
             if (plci->internal_command)
-              control_rc (plci, req, rc, ch, 0, TRUE);
+              control_rc (plci, req, rc, ch, 0, true);
           }
           else
           {
             channel_xmit_xon (plci);
-            control_rc (plci, req, rc, ch, 0, TRUE);
+            control_rc (plci, req, rc, ch, 0, true);
           }
         }
       }
@@ -3974,12 +3995,12 @@ void   callback(ENTITY   * e)
         if (rc != ASSIGN_OK)
           e->Id = 0;
         channel_xmit_xon (plci);
-        control_rc (plci, 0, rc, ch, global_req, FALSE);
+        control_rc (plci, 0, rc, ch, global_req, false);
       }
       else
       {
         channel_xmit_xon (plci);
-        control_rc (plci, req, rc, ch, 0, FALSE);
+        control_rc (plci, req, rc, ch, 0, false);
       }
     }
     /*
@@ -4057,7 +4078,7 @@ capi_callback_suffix:
     {
       if (m->header.command == _DATA_B3_R)
 
-        TransmitBufferFree (appl, (byte   *)(m->info.data_b3_req.Data));
+        TransmitBufferFree (appl, (byte *)(long)(m->info.data_b3_req.Data));
 
       dbug(1,dprintf("Error 0x%04x from msg(0x%04x)", i, m->header.command));
       break;
@@ -4065,8 +4086,8 @@ capi_callback_suffix:
 
     if (plci->li_notify_update)
     {
-      plci->li_notify_update = FALSE;
-      mixer_notify_update (plci, FALSE);
+      plci->li_notify_update = false;
+      mixer_notify_update (plci, false);
     }
 
   }
@@ -4075,7 +4096,8 @@ capi_callback_suffix:
 }
 
 
-void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte nl_rc)
+static void control_rc(PLCI *plci, byte req, byte rc, byte ch, byte global_req,
+                      byte nl_rc)
 {
   dword Id;
   dword rId;
@@ -4428,7 +4450,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
           else
           {
             sendf(appl,_INFO_R|CONFIRM,Id&0xf,Number,"w",_WRONG_STATE);
-            appl->NullCREnable = FALSE;
+            appl->NullCREnable = false;
             plci_remove(plci);
           }
         }
@@ -4441,7 +4463,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
           else
           {
             sendf(appl,_INFO_R|CONFIRM,Id&0xf,Number,"w",_WRONG_STATE);
-            appl->NullCREnable = FALSE;
+            appl->NullCREnable = false;
           }
           plci_remove(plci);
         }
@@ -4741,7 +4763,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
   }
 }
 
-void data_rc(PLCI   * plci, byte ch)
+static void data_rc(PLCI *plci, byte ch)
 {
   dword Id;
   DIVA_CAPI_ADAPTER   * a;
@@ -4777,7 +4799,7 @@ void data_rc(PLCI   * plci, byte ch)
   }
 }
 
-void data_ack(PLCI   * plci, byte ch)
+static void data_ack(PLCI *plci, byte ch)
 {
   dword Id;
   DIVA_CAPI_ADAPTER   * a;
@@ -4803,7 +4825,7 @@ void data_ack(PLCI   * plci, byte ch)
   }
 }
 
-void sig_ind(PLCI   * plci)
+static void sig_ind(PLCI *plci)
 {
   dword x_Id;
   dword Id;
@@ -4862,7 +4884,7 @@ void sig_ind(PLCI   * plci)
     byte CF_Ind[] = "\x09\x02\x00\x06\x00\x00\x00\x00\x00\x00";
     byte Interr_Err_Ind[] = "\x0a\x02\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
     byte CONF_Ind[] = "\x09\x16\x00\x06\x00\x00\0x00\0x00\0x00\0x00";
-  byte force_mt_info = FALSE;
+  byte force_mt_info = false;
   byte dir;
   dword d;
   word w;
@@ -4933,7 +4955,7 @@ void sig_ind(PLCI   * plci)
   {
     if(plci->cr_enquiry && plci->appl)
     {
-      plci->cr_enquiry = FALSE;
+      plci->cr_enquiry = false;
       /* d = MANU_ID            */
       /* w = m_command          */
       /* b = total length       */
@@ -4942,7 +4964,7 @@ void sig_ind(PLCI   * plci)
       /* b = IE1                */
       /* S = IE1 length + cont. */
       /* b = IE2                */
-      /* S = IE2 lenght + cont. */
+      /* S = IE2 length + cont. */
       sendf(plci->appl,
         _MANUFACTURER_I,
         Id,
@@ -5158,7 +5180,7 @@ void sig_ind(PLCI   * plci)
         if(application[i].CDEnable)
         {
           if(application[i].Id) sendf(&application[i],_FACILITY_I,Id,0,"ws",3, SS_Ind);
-          application[i].CDEnable = FALSE;
+          application[i].CDEnable = false;
         }
       }
       break;
@@ -5375,7 +5397,7 @@ void sig_ind(PLCI   * plci)
         if(application[i].CDEnable)
         {
           if(application[i].Id) sendf(&application[i],_FACILITY_I,Id,0,"ws",3, SS_Ind);
-          application[i].CDEnable = FALSE;
+          application[i].CDEnable = false;
         }
       }
       break;
@@ -5730,7 +5752,7 @@ void sig_ind(PLCI   * plci)
                         plci,
                         Id,
                         parms,
-                        SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, TRUE));
+                        SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, true));
         }
       }
       clear_c_ind_mask_bit (plci, MAX_APPL);
@@ -6117,38 +6139,38 @@ static void SendSetupInfo(APPL   * appl, PLCI   * plci, dword Id, byte   * * par
         dbug(1,dprintf("CPN "));
         Info_Number = 0x0070;
         Info_Mask   = 0x80;
-        Info_Sent_Flag = TRUE;
+        Info_Sent_Flag = true;
         break;
       case 8:  /* display      */
         dbug(1,dprintf("display(%d)",i));
         Info_Number = 0x0028;
         Info_Mask = 0x04;
-        Info_Sent_Flag = TRUE;
+        Info_Sent_Flag = true;
         break;
       case 16: /* Channel Id */
         dbug(1,dprintf("CHI"));
         Info_Number = 0x0018;
         Info_Mask = 0x100;
-        Info_Sent_Flag = TRUE;
+        Info_Sent_Flag = true;
         mixer_set_bchannel_id (plci, Info_Element);
         break;
       case 19: /* Redirected Number */
         dbug(1,dprintf("RDN"));
         Info_Number = 0x0074;
         Info_Mask = 0x400;
-        Info_Sent_Flag = TRUE;
+        Info_Sent_Flag = true;
         break;
       case 20: /* Redirected Number extended */
         dbug(1,dprintf("RDX"));
         Info_Number = 0x0073;
         Info_Mask = 0x400;
-        Info_Sent_Flag = TRUE;
+        Info_Sent_Flag = true;
         break;
       case 22: /* Redirecing Number  */
         dbug(1,dprintf("RIN"));
         Info_Number = 0x0076;
         Info_Mask = 0x400;
-        Info_Sent_Flag = TRUE;
+        Info_Sent_Flag = true;
         break;
       default:
         Info_Number = 0;
@@ -6171,7 +6193,7 @@ static void SendSetupInfo(APPL   * appl, PLCI   * plci, dword Id, byte   * * par
 }
 
 
-void SendInfo(PLCI   * plci, dword Id, byte   * * parms, byte iesent)
+static void SendInfo(PLCI *plci, dword Id, byte **parms, byte iesent)
 {
   word i;
   word j;
@@ -6312,7 +6334,7 @@ void SendInfo(PLCI   * plci, dword Id, byte   * * parms, byte iesent)
         && plci->adapter->Info_Mask[appl->Id-1] &Info_Mask)
         {
           dbug(1,dprintf("NCR_Ind"));
-          iesent=TRUE;
+          iesent=true;
           sendf(&application[j],_INFO_I,Id&0x0f,0,"wS",Info_Number,Info_Element);
         }
       }
@@ -6330,7 +6352,7 @@ void SendInfo(PLCI   * plci, dword Id, byte   * * parms, byte iesent)
           if(test_c_ind_mask_bit (plci, j))
           {
             dbug(1,dprintf("Ovl_Ind"));
-            iesent=TRUE;
+            iesent=true;
             sendf(&application[j],_INFO_I,Id,0,"wS",Info_Number,Info_Element);
           }
         }
@@ -6340,14 +6362,15 @@ void SendInfo(PLCI   * plci, dword Id, byte   * * parms, byte iesent)
     && plci->adapter->Info_Mask[plci->appl->Id-1] &Info_Mask)
     {
       dbug(1,dprintf("Std_Ind"));
-      iesent=TRUE;
+      iesent=true;
       sendf(plci->appl,_INFO_I,Id,0,"wS",Info_Number,Info_Element);
     }
   }
 }
 
 
-byte SendMultiIE(PLCI   * plci, dword Id, byte   * * parms, byte ie_type, dword info_mask, byte setupParse)
+static byte SendMultiIE(PLCI *plci, dword Id, byte **parms, byte ie_type,
+                       dword info_mask, byte setupParse)
 {
   word i;
   word j;
@@ -6391,7 +6414,7 @@ byte SendMultiIE(PLCI   * plci, dword Id, byte   * * parms, byte ie_type, dword
         && appl->Id
         && plci->adapter->Info_Mask[appl->Id-1] &Info_Mask)
         {
-          iesent = TRUE;
+          iesent = true;
           dbug(1,dprintf("Mlt_NCR_Ind"));
           sendf(&application[j],_INFO_I,Id&0x0f,0,"wS",Info_Number,Info_Element);
         }
@@ -6403,7 +6426,7 @@ byte SendMultiIE(PLCI   * plci, dword Id, byte   * * parms, byte ie_type, dword
       {
         if(test_c_ind_mask_bit (plci, j))
         {
-          iesent = TRUE;
+          iesent = true;
           dbug(1,dprintf("Mlt_Ovl_Ind"));
           sendf(&application[j],_INFO_I,Id,0,"wS",Info_Number,Info_Element);
         }
@@ -6412,7 +6435,7 @@ byte SendMultiIE(PLCI   * plci, dword Id, byte   * * parms, byte ie_type, dword
     else if(Info_Number
     && plci->adapter->Info_Mask[plci->appl->Id-1] &Info_Mask)
     {
-      iesent = TRUE;
+      iesent = true;
       dbug(1,dprintf("Mlt_Std_Ind"));
       sendf(plci->appl,_INFO_I,Id,0,"wS",Info_Number,Info_Element);
     }
@@ -6466,7 +6489,7 @@ static void SendSSExtInd(APPL   * appl, PLCI   * plci, dword Id, byte   * * parm
     }
 };
 
-void nl_ind(PLCI   * plci)
+static void nl_ind(PLCI *plci)
 {
   byte ch;
   word ncci;
@@ -6812,7 +6835,7 @@ void nl_ind(PLCI   * plci)
         }
         if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK))
         {
-          if (((T30_INFO   *)plci->NL.RBuffer->P)->code < sizeof(fax_info) / sizeof(fax_info[0]))
+         if (((T30_INFO   *)plci->NL.RBuffer->P)->code < ARRAY_SIZE(fax_info))
             info = fax_info[((T30_INFO   *)plci->NL.RBuffer->P)->code];
           else
             info = _FAX_PROTOCOL_ERROR;
@@ -6887,7 +6910,7 @@ void nl_ind(PLCI   * plci)
           (byte)(plci->ncpi_buffer[0] + 1), plci->ncpi_buffer);
         plci->ncpi_state |= NCPI_NEGOTIATE_B3_SENT;
  if (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)
-   fax_send_edata_ack = FALSE;
+   fax_send_edata_ack = false;
       }
 
       if (a->manufacturer_features & MANUFACTURER_FEATURE_FAX_PAPER_FORMATS)
@@ -6928,7 +6951,7 @@ void nl_ind(PLCI   * plci)
             sendf(plci->appl,_DISCONNECT_B3_I,Id,0,"wS",GOOD,plci->ncpi_buffer);
             a->ncci_state[ncci] = INC_DIS_PENDING;
             plci->ncpi_state = 0;
-     fax_send_edata_ack = FALSE;
+     fax_send_edata_ack = false;
           }
           break;
         }
@@ -7025,7 +7048,7 @@ void nl_ind(PLCI   * plci)
     }
     if (plci->adjust_b_restore)
     {
-      plci->adjust_b_restore = FALSE;
+      plci->adjust_b_restore = false;
       start_internal_command (Id, plci, adjust_b_restore);
     }
     break;
@@ -7041,7 +7064,7 @@ void nl_ind(PLCI   * plci)
         next_internal_command (Id, plci);
     }
     ncci_state = a->ncci_state[ncci];
-    ncci_remove (plci, ncci, FALSE);
+    ncci_remove (plci, ncci, false);
 
         /* with N_DISC or N_DISC_ACK the IDI frees the respective   */
         /* channel, so we cannot store the state in ncci_state! The */
@@ -7134,7 +7157,7 @@ void nl_ind(PLCI   * plci)
   case N_UDATA:
     if (!(udata_forwarding_table[plci->NL.RBuffer->P[0] >> 5] & (1L << (plci->NL.RBuffer->P[0] & 0x1f))))
     {
-      plci->RData[0].P = plci->internal_ind_buffer + (-((int)(plci->internal_ind_buffer)) & 3);
+      plci->RData[0].P = plci->internal_ind_buffer + (-((int)(long)(plci->internal_ind_buffer)) & 3);
       plci->RData[0].PLength = INTERNAL_IND_BUFFER_SIZE;
       plci->NL.R = plci->RData;
       plci->NL.RNum = 1;
@@ -7248,7 +7271,7 @@ void nl_ind(PLCI   * plci)
 /* find a free PLCI                                                 */
 /*------------------------------------------------------------------*/
 
-word get_plci(DIVA_CAPI_ADAPTER   * a)
+static word get_plci(DIVA_CAPI_ADAPTER *a)
 {
   word i,j;
   PLCI   * plci;
@@ -7288,18 +7311,18 @@ word get_plci(DIVA_CAPI_ADAPTER   * a)
   plci->msg_in_read_pos = MSG_IN_QUEUE_SIZE;
   plci->msg_in_wrap_pos = MSG_IN_QUEUE_SIZE;
 
-  plci->data_sent = FALSE;
+  plci->data_sent = false;
   plci->send_disc = 0;
   plci->sig_global_req = 0;
   plci->sig_remove_id = 0;
   plci->nl_global_req = 0;
   plci->nl_remove_id = 0;
   plci->adv_nl = 0;
-  plci->manufacturer = FALSE;
+  plci->manufacturer = false;
   plci->call_dir = CALL_DIR_OUT | CALL_DIR_ORIGINATE;
   plci->spoofed_msg = 0;
   plci->ptyState = 0;
-  plci->cr_enquiry = FALSE;
+  plci->cr_enquiry = false;
   plci->hangup_flow_ctrl_timer = 0;
 
   plci->ncci_ring_list = 0;
@@ -7407,7 +7430,7 @@ static void add_ie(PLCI   * plci, byte code, byte   * p, word p_length)
 /* put a unstructured data into the buffer                          */
 /*------------------------------------------------------------------*/
 
-void add_d(PLCI   * plci, word length, byte   * p)
+static void add_d(PLCI *plci, word length, byte *p)
 {
   word i;
 
@@ -7425,7 +7448,7 @@ void add_d(PLCI   * plci, word length, byte   * p)
 /* parameter buffer                                                 */
 /*------------------------------------------------------------------*/
 
-void add_ai(PLCI   * plci, API_PARSE * ai)
+static void add_ai(PLCI *plci, API_PARSE *ai)
 {
   word i;
     API_PARSE ai_parms[5];
@@ -7446,7 +7469,8 @@ void add_ai(PLCI   * plci, API_PARSE * ai)
 /* put parameter for b1 protocol in the parameter buffer            */
 /*------------------------------------------------------------------*/
 
-word add_b1(PLCI   * plci, API_PARSE * bp, word b_channel_info, word b1_facilities)
+static word add_b1(PLCI *plci, API_PARSE *bp, word b_channel_info,
+                  word b1_facilities)
 {
     API_PARSE bp_parms[8];
     API_PARSE mdm_cfg[9];
@@ -7910,7 +7934,7 @@ word add_b1(PLCI   * plci, API_PARSE * bp, word b_channel_info, word b1_faciliti
 /* put parameter for b2 and B3  protocol in the parameter buffer    */
 /*------------------------------------------------------------------*/
 
-word add_b23(PLCI   * plci, API_PARSE * bp)
+static word add_b23(PLCI *plci, API_PARSE *bp)
 {
   word i, fax_control_bits;
   byte pos, len;
@@ -7972,7 +7996,7 @@ word add_b23(PLCI   * plci, API_PARSE * bp)
 
   if(!bp->length && plci->tel)
   {
-    plci->adv_nl = TRUE;
+    plci->adv_nl = true;
     dbug(1,dprintf("Default adv.Nl"));
     add_p(plci,LLI,lli);
     plci->B2_prot = 1 /*XPARENT*/;
@@ -8022,7 +8046,7 @@ word add_b23(PLCI   * plci, API_PARSE * bp)
   {  
     if(GET_WORD(bp_parms[1].info)!=1
     || GET_WORD(bp_parms[2].info)!=0) return _B2_NOT_SUPPORTED;
-    plci->adv_nl = TRUE;
+    plci->adv_nl = true;
   }
   else if(plci->tel) return _B2_NOT_SUPPORTED;
 
@@ -8685,7 +8709,7 @@ static word add_modem_b23 (PLCI  * plci, API_PARSE* bp_parms)
 /* send a request for the signaling entity                          */
 /*------------------------------------------------------------------*/
 
-void sig_req(PLCI   * plci, byte req, byte Id)
+static void sig_req(PLCI *plci, byte req, byte Id)
 {
   if(!plci) return;
   if(plci->adapter->adapter_disabled) return;
@@ -8707,7 +8731,7 @@ void sig_req(PLCI   * plci, byte req, byte Id)
 /* send a request for the network layer entity                      */
 /*------------------------------------------------------------------*/
 
-void nl_req_ncci(PLCI   * plci, byte req, byte ncci)
+static void nl_req_ncci(PLCI *plci, byte req, byte ncci)
 {
   if(!plci) return;
   if(plci->adapter->adapter_disabled) return;
@@ -8729,7 +8753,7 @@ void nl_req_ncci(PLCI   * plci, byte req, byte ncci)
   plci->req_in_start = plci->req_in;
 }
 
-void send_req(PLCI   * plci)
+static void send_req(PLCI *plci)
 {
   ENTITY   * e;
   word l;
@@ -8785,7 +8809,7 @@ void send_req(PLCI   * plci)
   dbug(1,dprintf("send_ok"));
 }
 
-void send_data(PLCI   * plci)
+static void send_data(PLCI *plci)
 {
   DIVA_CAPI_ADAPTER   * a;
   DATA_B3_DESC   * data;
@@ -8840,7 +8864,7 @@ void send_data(PLCI   * plci)
             plci->NL.X = plci->NData;
             plci->NL.ReqCh = a->ncci_ch[ncci];
             dbug(1,dprintf("%x:DREQ(%x:%x)",a->Id,plci->NL.Id,plci->NL.Req));
-            plci->data_sent = TRUE;
+            plci->data_sent = true;
             plci->data_sent_ptr = data->P;
             a->request(&plci->NL);
           }
@@ -8864,7 +8888,7 @@ void send_data(PLCI   * plci)
   }
 }
 
-void listen_check(DIVA_CAPI_ADAPTER   * a)
+static void listen_check(DIVA_CAPI_ADAPTER *a)
 {
   word i,j;
   PLCI   * plci;
@@ -8907,7 +8931,7 @@ void listen_check(DIVA_CAPI_ADAPTER   * a)
 /* functions for all parameters sent in INDs                        */
 /*------------------------------------------------------------------*/
 
-void IndParse(PLCI   * plci, word * parms_id, byte   ** parms, byte multiIEsize)
+static void IndParse(PLCI *plci, word *parms_id, byte **parms, byte multiIEsize)
 {
   word ploc;            /* points to current location within packet */
   byte w;
@@ -8992,16 +9016,16 @@ void IndParse(PLCI   * plci, word * parms_id, byte   ** parms, byte multiIEsize)
 /* try to match a cip from received BC and HLC                      */
 /*------------------------------------------------------------------*/
 
-byte ie_compare(byte   * ie1, byte * ie2)
+static byte ie_compare(byte *ie1, byte *ie2)
 {
   word i;
-  if(!ie1 || ! ie2) return FALSE;
-  if(!ie1[0]) return FALSE;
-  for(i=0;i<(word)(ie1[0]+1);i++) if(ie1[i]!=ie2[i]) return FALSE;
-  return TRUE;
+  if(!ie1 || ! ie2) return false;
+  if(!ie1[0]) return false;
+  for(i=0;i<(word)(ie1[0]+1);i++) if(ie1[i]!=ie2[i]) return false;
+  return true;
 }
 
-word find_cip(DIVA_CAPI_ADAPTER   * a, byte   * bc, byte   * hlc)
+static word find_cip(DIVA_CAPI_ADAPTER *a, byte *bc, byte *hlc)
 {
   word i;
   word j;
@@ -9028,7 +9052,7 @@ static byte AddInfo(byte   **add_i,
    /* facility is a nested structure */
    /* FTY can be more than once      */
 
-  if(esc_chi[0] && !(esc_chi[esc_chi[0]])&0x7f )
+       if (esc_chi[0] && !(esc_chi[esc_chi[0]] & 0x7f))
   {
     add_i[0] = (byte   *)"\x02\x02\x00"; /* use neither b nor d channel */
   }
@@ -9069,7 +9093,7 @@ static byte AddInfo(byte   **add_i,
 /* voice and codec features                                         */
 /*------------------------------------------------------------------*/
 
-void SetVoiceChannel(PLCI   *plci, byte   *chi, DIVA_CAPI_ADAPTER   * a)
+static void SetVoiceChannel(PLCI *plci, byte *chi, DIVA_CAPI_ADAPTER *a)
 {
   byte voice_chi[] = "\x02\x18\x01";
   byte channel;
@@ -9087,7 +9111,7 @@ void SetVoiceChannel(PLCI   *plci, byte   *chi, DIVA_CAPI_ADAPTER   * a)
   }
 }
 
-void VoiceChannelOff(PLCI   *plci)
+static void VoiceChannelOff(PLCI *plci)
 {
   dbug(1,dprintf("ExtDevOFF"));
   add_p(plci,FTY,"\x02\x01\x08");             /* B Off */
@@ -9100,7 +9124,8 @@ void VoiceChannelOff(PLCI   *plci)
 }
 
 
-word AdvCodecSupport(DIVA_CAPI_ADAPTER   *a, PLCI   *plci, APPL   *appl, byte hook_listen)
+static word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl,
+                           byte hook_listen)
 {
   word j;
   PLCI   *splci;
@@ -9120,7 +9145,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER   *a, PLCI   *plci, APPL   *appl, byte ho
         dbug(1,dprintf("AdvSigPlci=0x%x",a->AdvSignalPLCI));
         return 0x2001; /* codec in use by another application */
       }
-      if(plci!=0)
+      if(plci!=NULL)
       {
         a->AdvSignalPLCI = plci;
         plci->tel=ADV_VOICE;
@@ -9145,13 +9170,13 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER   *a, PLCI   *plci, APPL   *appl, byte ho
         }
                                                /* indicate D-ch connect if  */
       }                                        /* codec is connected OK     */
-      if(plci!=0)
+      if(plci!=NULL)
       {
         a->AdvSignalPLCI = plci;
         plci->tel=ADV_VOICE;
       }
       a->AdvSignalAppl = appl;
-      a->AdvCodecFLAG = TRUE;
+      a->AdvCodecFLAG = true;
       a->AdvCodecPLCI = splci;
       add_p(splci,CAI,"\x01\x15");
       add_p(splci,LLI,"\x01\x00");
@@ -9171,7 +9196,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER   *a, PLCI   *plci, APPL   *appl, byte ho
   {
     if(hook_listen) return 0x300B;               /* Facility not supported */
                                                  /* no hook with SCOM      */
-    if(plci!=0) plci->tel = CODEC;
+    if(plci!=NULL) plci->tel = CODEC;
     dbug(1,dprintf("S/SCOM codec"));
     /* first time we use the scom-s codec we must shut down the internal   */
     /* handset application of the card. This can be done by an assign with */
@@ -9183,7 +9208,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER   *a, PLCI   *plci, APPL   *appl, byte ho
         add_p(splci,UID,"\x06\x43\x61\x70\x69\x32\x30");
         sig_req(splci,ASSIGN,0xC0);  /* 0xc0 is the TEL_ID */
         send_req(splci);
-        a->scom_appl_disable = TRUE;
+        a->scom_appl_disable = true;
       }
       else{
         return 0x2001; /* wrong state, no more plcis */
@@ -9196,7 +9221,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER   *a, PLCI   *plci, APPL   *appl, byte ho
 }
 
 
-void CodecIdCheck(DIVA_CAPI_ADAPTER   *a, PLCI   *plci)
+static void CodecIdCheck(DIVA_CAPI_ADAPTER *a, PLCI *plci)
 {
 
   dbug(1,dprintf("CodecIdCheck"));
@@ -9411,7 +9436,7 @@ word CapiRelease(word Id)
       }
       if(a->AdvSignalAppl==this)
       {
-        this->NullCREnable = FALSE;
+        this->NullCREnable = false;
         if (a->AdvCodecPLCI)
         {
           plci_remove(a->AdvCodecPLCI);
@@ -9433,7 +9458,7 @@ word CapiRelease(word Id)
 
 static word plci_remove_check(PLCI   *plci)
 {
-  if(!plci) return TRUE;
+  if(!plci) return true;
   if(!plci->NL.Id && c_ind_mask_empty (plci))
   {
     if(plci->Sig.Id == 0xff)
@@ -9446,7 +9471,7 @@ static word plci_remove_check(PLCI   *plci)
       {
         CodecIdCheck(plci->adapter, plci);
         clear_b1_config (plci);
-        ncci_remove (plci, 0, FALSE);
+        ncci_remove (plci, 0, false);
         plci_free_msg_in_queue (plci);
         channel_flow_control_remove (plci);
         plci->Id = 0;
@@ -9456,10 +9481,10 @@ static word plci_remove_check(PLCI   *plci)
         plci->notifiedcall = 0;
       }
       listen_check(plci->adapter);
-      return TRUE;
+      return true;
     }
   }
-  return FALSE;
+  return false;
 }
 
 
@@ -9564,7 +9589,7 @@ static struct
 
 };
 
-#define DTMF_DIGIT_MAP_ENTRIES (sizeof(dtmf_digit_map) / sizeof(dtmf_digit_map[0]))
+#define DTMF_DIGIT_MAP_ENTRIES ARRAY_SIZE(dtmf_digit_map)
 
 
 static void dtmf_enable_receiver (PLCI   *plci, byte enable_mask)
@@ -9815,7 +9840,7 @@ static void dtmf_command (dword Id, PLCI   *plci, byte Rc)
         }
         plci->dtmf_rec_active &= ~mask;
         plci->internal_command = DTMF_COMMAND_2;
-        dtmf_enable_receiver (plci, FALSE);
+        dtmf_enable_receiver (plci, false);
         return;
       }
       Rc = OK;
@@ -10020,7 +10045,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
           }
         }
         start_internal_command (Id, plci, dtmf_command);
-        return (FALSE);
+        return (false);
 
 
       case DTMF_SEND_TONE:
@@ -10069,8 +10094,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
           PUT_WORD (&result[1], DTMF_INCORRECT_DIGIT);
           break;
         }
-        if (plci->dtmf_send_requests >=
-          sizeof(plci->dtmf_msg_number_queue) / sizeof(plci->dtmf_msg_number_queue[0]))
+        if (plci->dtmf_send_requests >= ARRAY_SIZE(plci->dtmf_msg_number_queue))
         {
           dbug (1, dprintf ("[%06lx] %s,%d: DTMF request overrun",
             UnMapId (Id), (char   *)(FILE_), __LINE__));
@@ -10079,7 +10103,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
         }
         api_save_msg (dtmf_parms, "wwws", &plci->saved_msg);
         start_internal_command (Id, plci, dtmf_command);
-        return (FALSE);
+        return (false);
 
       default:
         dbug (1, dprintf ("[%06lx] %s,%d: DTMF unknown request %04x",
@@ -10090,7 +10114,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
   }
   sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number,
     "wws", Info, SELECTOR_DTMF, result);
-  return (FALSE);
+  return (false);
 }
 
 
@@ -10842,10 +10866,10 @@ static struct
   byte to_pc;
 } xconnect_write_prog[] =
 {
-  { LI_COEF_CH_CH, FALSE, FALSE },
-  { LI_COEF_CH_PC, FALSE, TRUE },
-  { LI_COEF_PC_CH, TRUE, FALSE },
-  { LI_COEF_PC_PC, TRUE, TRUE }
+  { LI_COEF_CH_CH, false, false },
+  { LI_COEF_CH_PC, false, true },
+  { LI_COEF_PC_CH, true, false },
+  { LI_COEF_PC_PC, true, true }
 };
 
 
@@ -10916,7 +10940,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
   {
     dbug (1, dprintf ("[%06x] %s,%d: Channel id wiped out",
       UnMapId (Id), (char   *)(FILE_), __LINE__));
-    return (TRUE);
+    return (true);
   }
   i = a->li_base + (plci->li_bchannel_id - 1);
   j = plci->li_write_channel;
@@ -10927,7 +10951,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
     {
       dbug (1, dprintf ("[%06lx] %s,%d: LI write coefs failed %02x",
         UnMapId (Id), (char   *)(FILE_), __LINE__, Rc));
-      return (FALSE);
+      return (false);
     }
   }
   if (li_config_table[i].adapter->manufacturer_features & MANUFACTURER_FEATURE_XCONNECT)
@@ -10969,7 +10993,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
     {
       plci->internal_command = plci->li_write_command;
       if (plci_nl_busy (plci))
-        return (TRUE);
+        return (true);
       to_ch = (a->li_pri) ? plci->li_bchannel_id - 1 : 0;
       *(p++) = UDATA_REQUEST_XCONNECT_TO;
       do
@@ -11018,9 +11042,9 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
             li_config_table[i].coef_table[j] ^= xconnect_write_prog[n].mask << 4;
           }
           n++;
-        } while ((n < sizeof(xconnect_write_prog) / sizeof(xconnect_write_prog[0]))
+        } while ((n < ARRAY_SIZE(xconnect_write_prog))
           && ((p - plci->internal_req_buffer) + 16 < INTERNAL_REQ_BUFFER_SIZE));
-        if (n == sizeof(xconnect_write_prog) / sizeof(xconnect_write_prog[0]))
+        if (n == ARRAY_SIZE(xconnect_write_prog))
         {
           do
           {
@@ -11050,7 +11074,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
     {
       plci->internal_command = plci->li_write_command;
       if (plci_nl_busy (plci))
-        return (TRUE);
+        return (true);
       if (a->li_pri)
       {
         *(p++) = UDATA_REQUEST_SET_MIXER_COEFS_PRI_SYNC;
@@ -11090,7 +11114,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
             ch_map[j+1] = (byte)(j+1);
           }
         }
-        for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++)
+        for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++)
         {
           i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch];
           j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch];
@@ -11127,7 +11151,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
     {
       plci->internal_command = plci->li_write_command;
       if (plci_nl_busy (plci))
-        return (TRUE);
+        return (true);
       if (j < a->li_base)
         j = a->li_base;
       if (a->li_pri)
@@ -11140,7 +11164,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
           w |= MIXER_FEATURE_ENABLE_RX_DATA;
         *(p++) = (byte) w;
         *(p++) = (byte)(w >> 8);
-        for (n = 0; n < sizeof(mixer_write_prog_pri) / sizeof(mixer_write_prog_pri[0]); n++)
+        for (n = 0; n < ARRAY_SIZE(mixer_write_prog_pri); n++)
         {
           *(p++) = (byte)((plci->li_bchannel_id - 1) | mixer_write_prog_pri[n].line_flags);
           for (j = a->li_base; j < a->li_base + MIXER_CHANNELS_PRI; j++)
@@ -11196,7 +11220,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
             ch_map[j+1] = (byte)(j+1);
           }
         }
-        for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++)
+        for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++)
         {
           i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch];
           j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch];
@@ -11232,7 +11256,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI   *plci, byte Rc)
     plci->NL.Req = plci->nl_req = (byte) N_UDATA;
     plci->adapter->request (&plci->NL);
   }
-  return (TRUE);
+  return (true);
 }
 
 
@@ -11251,7 +11275,7 @@ static void mixer_notify_update (PLCI   *plci, byte others)
   if (a->profile.Global_Options & GL_LINE_INTERCONNECT_SUPPORTED)
   {
     if (others)
-      plci->li_notify_update = TRUE;
+      plci->li_notify_update = true;
     i = 0;
     do
     {
@@ -11277,7 +11301,7 @@ static void mixer_notify_update (PLCI   *plci, byte others)
        && (notify_plci->State)
        && notify_plci->NL.Id && !notify_plci->nl_remove_id)
       {
-        notify_plci->li_notify_update = TRUE;
+        notify_plci->li_notify_update = true;
         ((CAPI_MSG *) msg)->header.length = 18;
         ((CAPI_MSG *) msg)->header.appl_id = notify_plci->appl->Id;
         ((CAPI_MSG *) msg)->header.command = _FACILITY_R;
@@ -11299,12 +11323,12 @@ static void mixer_notify_update (PLCI   *plci, byte others)
               (char   *)(FILE_), __LINE__,
               (dword)((notify_plci->Id << 8) | UnMapController (notify_plci->adapter->Id)), w));
           }
-          notify_plci->li_notify_update = FALSE;
+          notify_plci->li_notify_update = false;
         }
       }
     } while (others && (notify_plci != NULL));
     if (others)
-      plci->li_notify_update = FALSE;
+      plci->li_notify_update = false;
   }
 }
 
@@ -11318,7 +11342,7 @@ static void mixer_clear_config (PLCI   *plci)
     (dword)((plci->Id << 8) | UnMapController (plci->adapter->Id)),
     (char   *)(FILE_), __LINE__));
 
-  plci->li_notify_update = FALSE;
+  plci->li_notify_update = false;
   plci->li_plci_b_write_pos = 0;
   plci->li_plci_b_read_pos = 0;
   plci->li_plci_b_req_pos = 0;
@@ -12159,7 +12183,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
         plci_b = li_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[8]);
         if (plci_b == NULL)
           break;
-        li_update_connect (Id, a, plci, plci_b_id, TRUE, li_flags);
+        li_update_connect (Id, a, plci, plci_b_id, true, li_flags);
         plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_LAST_FLAG;
         plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1;
         plci->li_plci_b_write_pos = plci_b_write_pos;
@@ -12188,7 +12212,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
         plci_b_write_pos = plci->li_plci_b_write_pos;
         participant_parms_pos = 0;
         result_pos = 7;
-        li2_update_connect (Id, a, plci, UnMapId (Id), TRUE, li_flags);
+        li2_update_connect (Id, a, plci, UnMapId (Id), true, li_flags);
         while (participant_parms_pos < li_req_parms[1].length)
         {
           result[result_pos] = 6;
@@ -12224,7 +12248,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
           plci_b = li2_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[result_pos - 2]);
           if (plci_b != NULL)
           {
-            li2_update_connect (Id, a, plci, plci_b_id, TRUE, li_flags);
+            li2_update_connect (Id, a, plci, plci_b_id, true, li_flags);
             plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id |
               ((li_flags & (LI2_FLAG_INTERCONNECT_A_B | LI2_FLAG_INTERCONNECT_B_A |
               LI2_FLAG_PCCONNECT_A_B | LI2_FLAG_PCCONNECT_B_A)) ? 0 : LI_PLCI_B_DISC_FLAG);
@@ -12249,13 +12273,13 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
       }
       mixer_calculate_coefs (a);
       plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel;
-      mixer_notify_update (plci, TRUE);
+      mixer_notify_update (plci, true);
       sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number,
         "wwS", Info, SELECTOR_LINE_INTERCONNECT, result);
       plci->command = 0;
       plci->li_cmd = GET_WORD (li_parms[0].info);
       start_internal_command (Id, plci, mixer_command);
-      return (FALSE);
+      return (false);
 
     case LI_REQ_DISCONNECT:
       if (li_parms[1].length == 4)
@@ -12283,7 +12307,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
         plci_b = li_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[8]);
         if (plci_b == NULL)
           break;
-        li_update_connect (Id, a, plci, plci_b_id, FALSE, 0);
+        li_update_connect (Id, a, plci, plci_b_id, false, 0);
         plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG | LI_PLCI_B_LAST_FLAG;
         plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1;
         plci->li_plci_b_write_pos = plci_b_write_pos;
@@ -12345,7 +12369,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
           plci_b = li2_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[result_pos - 2]);
           if (plci_b != NULL)
           {
-            li2_update_connect (Id, a, plci, plci_b_id, FALSE, 0);
+            li2_update_connect (Id, a, plci, plci_b_id, false, 0);
             plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG;
             plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1;
           }
@@ -12368,13 +12392,13 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
       }
       mixer_calculate_coefs (a);
       plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel;
-      mixer_notify_update (plci, TRUE);
+      mixer_notify_update (plci, true);
       sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number,
         "wwS", Info, SELECTOR_LINE_INTERCONNECT, result);
       plci->command = 0;
       plci->li_cmd = GET_WORD (li_parms[0].info);
       start_internal_command (Id, plci, mixer_command);
-      return (FALSE);
+      return (false);
 
     case LI_REQ_SILENT_UPDATE:
       if (!plci || !plci->State
@@ -12384,7 +12408,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
       {
         dbug (1, dprintf ("[%06lx] %s,%d: Wrong state",
           UnMapId (Id), (char   *)(FILE_), __LINE__));
-        return (FALSE);
+        return (false);
       }
       plci_b_write_pos = plci->li_plci_b_write_pos;
       if (((plci->li_plci_b_read_pos > plci_b_write_pos) ? plci->li_plci_b_read_pos :
@@ -12392,7 +12416,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
       {
         dbug (1, dprintf ("[%06lx] %s,%d: LI request overrun",
           UnMapId (Id), (char   *)(FILE_), __LINE__));
-        return (FALSE);
+        return (false);
       }
       i = (plci_b_write_pos == 0) ? LI_PLCI_B_QUEUE_ENTRIES-1 : plci_b_write_pos - 1;
       if ((plci_b_write_pos == plci->li_plci_b_read_pos)
@@ -12408,7 +12432,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
       plci->command = 0;
       plci->li_cmd = GET_WORD (li_parms[0].info);
       start_internal_command (Id, plci, mixer_command);
-      return (FALSE);
+      return (false);
 
     default:
       dbug (1, dprintf ("[%06lx] %s,%d: LI unknown request %04x",
@@ -12418,7 +12442,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI
   }
   sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number,
     "wwS", Info, SELECTOR_LINE_INTERCONNECT, result);
-  return (FALSE);
+  return (false);
 }
 
 
@@ -12523,7 +12547,7 @@ static void mixer_indication_xconnect_from (dword Id, PLCI   *plci, byte   *msg,
     if (!plci->internal_command)
       next_internal_command (Id, plci);
   }
-  mixer_notify_update (plci, TRUE);
+  mixer_notify_update (plci, true);
 }
 
 
@@ -12547,12 +12571,12 @@ static byte mixer_notify_source_removed (PLCI   *plci, dword plci_b_id)
     dbug (1, dprintf ("[%06lx] %s,%d: LI request overrun",
       (dword)((plci->Id << 8) | UnMapController (plci->adapter->Id)),
       (char   *)(FILE_), __LINE__));
-    return (FALSE);
+    return (false);
   }
   plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG;
   plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1;
   plci->li_plci_b_write_pos = plci_b_write_pos;
-  return (TRUE);
+  return (true);
 }
 
 
@@ -12596,7 +12620,7 @@ static void mixer_remove (PLCI   *plci)
         }
         mixer_clear_config (plci);
         mixer_calculate_coefs (a);
-        mixer_notify_update (plci, TRUE);
+        mixer_notify_update (plci, true);
       }
       li_config_table[i].plci = NULL;
       plci->li_bchannel_id = 0;
@@ -12883,29 +12907,29 @@ static byte ec_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI   *p
           case EC_ENABLE_OPERATION:
             plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           case EC_DISABLE_OPERATION:
             plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER |
               LEC_MANUAL_DISABLE | LEC_ENABLE_NONLINEAR_PROCESSING |
               LEC_RESET_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           case EC_FREEZE_COEFFICIENTS:
             plci->ec_idi_options |= LEC_FREEZE_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           case EC_RESUME_COEFFICIENT_UPDATE:
             plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           case EC_RESET_COEFFICIENTS:
             plci->ec_idi_options |= LEC_RESET_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           default:
             dbug (1, dprintf ("[%06lx] %s,%d: EC unknown request %04x",
@@ -12978,14 +13002,14 @@ static byte ec_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI   *p
           case EC_ENABLE_OPERATION:
             plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           case EC_DISABLE_OPERATION:
             plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER |
               LEC_MANUAL_DISABLE | LEC_ENABLE_NONLINEAR_PROCESSING |
               LEC_RESET_COEFFICIENTS;
             start_internal_command (Id, plci, ec_command);
-            return (FALSE);
+            return (false);
 
           default:
             dbug (1, dprintf ("[%06lx] %s,%d: EC unknown request %04x",
@@ -12999,7 +13023,7 @@ static byte ec_request (dword Id, word Number, DIVA_CAPI_ADAPTER   *a, PLCI   *p
   sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number,
     "wws", Info, (appl->appl_flags & APPL_FLAG_PRIV_EC_SPEC) ?
     PRIV_SELECTOR_ECHO_CANCELLER : SELECTOR_ECHO_CANCELLER, result);
-  return (FALSE);
+  return (false);
 }
 
 
@@ -13178,7 +13202,7 @@ static void adv_voice_write_coefs (PLCI   *plci, word write_command)
         ch_map[j] = (byte)(j + (plci->li_bchannel_id - 1));
         ch_map[j+1] = (byte)(j + (2 - plci->li_bchannel_id));
       }
-      for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++)
+      for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++)
       {
         i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch];
         j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch];
@@ -13563,7 +13587,7 @@ static void adjust_b_clear (PLCI   *plci)
     (dword)((plci->Id << 8) | UnMapController (plci->adapter->Id)),
     (char   *)(FILE_), __LINE__));
 
-  plci->adjust_b_restore = FALSE;
+  plci->adjust_b_restore = false;
 }
 
 
@@ -13832,7 +13856,7 @@ static word adjust_b_process (dword Id, PLCI   *plci, byte Rc)
     }
     if (plci->adjust_b_mode & ADJUST_B_MODE_USER_CONNECT)
     {
-      plci->adjust_b_restore = TRUE;
+      plci->adjust_b_restore = true;
       break;
     }
     plci->adjust_b_state = ADJUST_B_CONNECT_1;
@@ -14603,10 +14627,10 @@ static void channel_request_xon (PLCI   * plci, byte ch) {
 
 static void channel_xmit_extended_xon (PLCI   * plci) {
   DIVA_CAPI_ADAPTER   * a;
-  int max_ch = sizeof(a->ch_flow_control)/sizeof(a->ch_flow_control[0]);
+  int max_ch = ARRAY_SIZE(a->ch_flow_control);
   int i, one_requested = 0;
 
-  if ((!plci) || (!plci->Id) || ((a = plci->adapter) == 0)) {
+  if ((!plci) || (!plci->Id) || ((a = plci->adapter) == NULL)) {
     return;
   }
 
@@ -14628,7 +14652,7 @@ static void channel_xmit_extended_xon (PLCI   * plci) {
   Try to xmit next X_ON
   */
 static int find_channel_with_pending_x_on (DIVA_CAPI_ADAPTER   * a, PLCI   * plci) {
-  int max_ch = sizeof(a->ch_flow_control)/sizeof(a->ch_flow_control[0]);
+  int max_ch = ARRAY_SIZE(a->ch_flow_control);
   int i;
 
   if (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL)) {
@@ -14768,19 +14792,19 @@ static void group_optimization(DIVA_CAPI_ADAPTER   * a, PLCI   * plci)
   {
     if(application[i].Id && a->CIP_Mask[i] )
     {
-      for(k=0,busy=FALSE; k<a->max_plci; k++)
+      for(k=0,busy=false; k<a->max_plci; k++)
       {
         if(a->plci[k].Id) 
         {
           auxplci = &a->plci[k];
           if(auxplci->appl == &application[i]) /* application has a busy PLCI */
           {
-            busy = TRUE;
+            busy = true;
             dbug(1,dprintf("Appl 0x%x is busy",i+1));
           }
           else if(test_c_ind_mask_bit (auxplci, i)) /* application has an incoming call pending */
           {
-            busy = TRUE;
+            busy = true;
             dbug(1,dprintf("Appl 0x%x has inc. call pending",i+1));
           }
         }
@@ -14791,13 +14815,13 @@ static void group_optimization(DIVA_CAPI_ADAPTER   * a, PLCI   * plci)
         if(j==MAX_CIP_TYPES)       /* all groups are in use but group still not found */
         {                           /* the MAX_CIP_TYPES group enables all calls because of field overflow */
           appl_number_group_type[i] = MAX_CIP_TYPES;
-          group_found=TRUE;
+          group_found=true;
           dbug(1,dprintf("Field overflow appl 0x%x",i+1));
         }
         else if( (info_mask_group[j]==a->CIP_Mask[i]) && (cip_mask_group[j]==a->Info_Mask[i]) )  
         {                                      /* is group already present ?                  */
           appl_number_group_type[i] = j|0x80;  /* store the group number for each application */
-          group_found=TRUE;
+          group_found=true;
           dbug(1,dprintf("Group 0x%x found with appl 0x%x, CIP=0x%lx",appl_number_group_type[i],i+1,info_mask_group[j]));
         }
         else if(!info_mask_group[j])
@@ -14805,7 +14829,7 @@ static void group_optimization(DIVA_CAPI_ADAPTER   * a, PLCI   * plci)
           appl_number_group_type[i] = j|0x80;  /* store the group number for each application */
           info_mask_group[j] = a->CIP_Mask[i]; /* store the new CIP mask for the new group    */
           cip_mask_group[j] = a->Info_Mask[i]; /* store the new Info_Mask for this new group  */
-          group_found=TRUE;
+          group_found=true;
           dbug(1,dprintf("New Group 0x%x established with appl 0x%x, CIP=0x%lx",appl_number_group_type[i],i+1,info_mask_group[j]));
         }
       }
@@ -14860,7 +14884,7 @@ word CapiRegister(word id)
     }
   }
 
-  if(appls_found) return TRUE;
+  if(appls_found) return true;
   for(i=0; i<max_adapter; i++)                   /* scan all adapters...    */
   {
     a = &adapter[i];
@@ -14889,7 +14913,7 @@ word CapiRegister(word id)
       }
     }
   }
-  return FALSE;
+  return false;
 }
 
 /*------------------------------------------------------------------*/