various minor portability fixes (mostly from tholo for OpenBSD)
[asterisk/asterisk.git] / codecs / gsm / src / gsm_option.c
1 /*
2  * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
3  * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
4  * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
5  */
6
7 /* $Header$ */
8
9 #include "private.h"
10
11 #include "gsm.h"
12 #include "proto.h"
13
14 int gsm_option P3((r, opt, val), gsm r, int opt, int * val)
15 {
16         int     result = -1;
17
18         switch (opt) {
19         case GSM_OPT_LTP_CUT:
20 #ifdef  LTP_CUT
21                 result = r->ltp_cut;
22                 if (val) r->ltp_cut = *val;
23 #endif
24                 break;
25
26         case GSM_OPT_VERBOSE:
27 #ifndef NDEBUG
28                 result = r->verbose;
29                 if (val) r->verbose = *val;
30 #endif
31                 break;
32
33         case GSM_OPT_FAST:
34
35 #if     defined(FAST) && defined(USE_FLOAT_MUL)
36                 result = r->fast;
37                 if (val) r->fast = !!*val;
38 #endif
39                 break;
40
41         case GSM_OPT_FRAME_CHAIN:
42
43 #ifdef WAV49
44                 result = r->frame_chain;
45                 if (val) r->frame_chain = *val;
46 #endif
47                 break;
48
49         case GSM_OPT_FRAME_INDEX:
50
51 #ifdef WAV49
52                 result = r->frame_index;
53                 if (val) r->frame_index = *val;
54 #endif
55                 break;
56
57         case GSM_OPT_WAV49:
58
59 #ifdef WAV49 
60                 result = r->wav_fmt;
61                 if (val) r->wav_fmt = !!*val;
62 #endif
63                 break;
64
65         default:
66                 break;
67         }
68         return result;
69 }