]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
windows build.
authorMichael Jerris <mike@jerris.com>
Sun, 17 Jun 2007 19:40:35 +0000 (19:40 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 17 Jun 2007 19:40:35 +0000 (19:40 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@270 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/include/openzap.h
libs/freetdm/src/libteletone_detect.c
libs/freetdm/src/zap_io.c
libs/freetdm/src/zap_isdn.c

index c95849df433505a788a2f365d378be13623127a1..afbf11fbc98d82b4ac40016644ca5c79c7ba4298 100644 (file)
@@ -482,7 +482,7 @@ void zap_global_set_logger(zap_logger_t logger);
 void zap_global_set_default_logger(int level);
 uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen);
 void print_bits(uint8_t *b, int bl, char *buf, int blen, int e, uint8_t ss);
-void print_hex_bytes(uint8_t *data, zap_size_t dlen, uint8_t *buf, zap_size_t blen);
+void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen);
 ZIO_CODEC_FUNCTION(zio_slin2ulaw);
 ZIO_CODEC_FUNCTION(zio_ulaw2slin);
 ZIO_CODEC_FUNCTION(zio_slin2alaw);
index b5ba7e361dd3b5a42fd20ca008434db83d57245d..7a3bf0d406da59c576437301b37a4221b25407fe 100644 (file)
@@ -126,11 +126,11 @@ void teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
        for (i = 0;      i < samples;  i++) {
                v1 = goertzel_state->v2;
                goertzel_state->v2 = goertzel_state->v3;
-               goertzel_state->v3 = goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i];
+               goertzel_state->v3 = (float)(goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i]);
        }
 }
 
-#define teletone_goertzel_result(gs) ((gs)->v3 * (gs)->v3 + (gs)->v2 * (gs)->v2 - (gs)->v2 * (gs)->v3 * (gs)->fac)
+#define teletone_goertzel_result(gs) (float)(((gs)->v3 * (gs)->v3 + (gs)->v2 * (gs)->v2 - (gs)->v2 * (gs)->v3 * (gs)->fac))
 
 void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate)
 {
@@ -140,17 +140,17 @@ void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state,
        dtmf_detect_state->hit1 = dtmf_detect_state->hit2 = 0;
 
        for (i = 0;      i < GRID_FACTOR;  i++) {
-               theta = M_TWO_PI*(dtmf_row[i]/(float)sample_rate);
-               dtmf_detect_row[i].fac = 2.0*cos(theta);
+               theta = (float)(M_TWO_PI*(dtmf_row[i]/(float)sample_rate));
+               dtmf_detect_row[i].fac = (float)(2.0*cos(theta));
 
-               theta = M_TWO_PI*(dtmf_col[i]/(float)sample_rate);
-               dtmf_detect_col[i].fac = 2.0*cos(theta);
+               theta = (float)(M_TWO_PI*(dtmf_col[i]/(float)sample_rate));
+               dtmf_detect_col[i].fac = (float)(2.0*cos(theta));
        
-               theta = M_TWO_PI*(dtmf_row[i]*2.0/(float)sample_rate);
-               dtmf_detect_row_2nd[i].fac = 2.0*cos(theta);
+               theta = (float)(M_TWO_PI*(dtmf_row[i]*2.0/(float)sample_rate));
+               dtmf_detect_row_2nd[i].fac = (float)(2.0*cos(theta));
 
-               theta = M_TWO_PI*(dtmf_col[i]*2.0/(float)sample_rate);
-               dtmf_detect_col_2nd[i].fac = 2.0*cos(theta);
+               theta = (float)(M_TWO_PI*(dtmf_col[i]*2.0/(float)sample_rate));
+               dtmf_detect_col_2nd[i].fac = (float)(2.0*cos(theta));
        
                goertzel_init (&dtmf_detect_state->row_out[i], &dtmf_detect_row[i]);
                goertzel_init (&dtmf_detect_state->col_out[i], &dtmf_detect_col[i]);
@@ -196,8 +196,8 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
                        break;
                }
                mt->tone_count++;
-               theta = M_TWO_PI*(map->freqs[x]/(float)mt->sample_rate);
-               mt->tdd[x].fac = 2.0 * cos(theta);
+               theta = (float)(M_TWO_PI*(map->freqs[x]/(float)mt->sample_rate));
+               mt->tdd[x].fac = (float)(2.0 * cos(theta));
                goertzel_init (&mt->gs[x], &mt->tdd[x]);
                goertzel_init (&mt->gs2[x], &mt->tdd[x]);
        }
@@ -230,11 +230,11 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
                        for(x = 0; x < mt->tone_count; x++) {
                                v1 = mt->gs[x].v2;
                                mt->gs[x].v2 = mt->gs[x].v3;
-                               mt->gs[x].v3 = mt->gs[x].fac * mt->gs[x].v2 - v1 + famp;
+                               mt->gs[x].v3 = (float)(mt->gs[x].fac * mt->gs[x].v2 - v1 + famp);
        
                                v1 = mt->gs2[x].v2;
                                mt->gs2[x].v2 = mt->gs2[x].v3;
-                               mt->gs2[x].v3 = mt->gs2[x].fac*mt->gs2[x].v2 - v1 + famp;
+                               mt->gs2[x].v3 = (float)(mt->gs2[x].fac*mt->gs2[x].v2 - v1 + famp);
                        }
                }
 
@@ -245,7 +245,7 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
 
                eng_sum = 0;
                for(x = 0; x < mt->tone_count; x++) {
-                       eng_all[x] = teletone_goertzel_result (&mt->gs[x]);
+                       eng_all[x] = (float)(teletone_goertzel_result (&mt->gs[x]));
                        eng_sum += eng_all[x];
                }
 
@@ -325,19 +325,19 @@ int teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
                        for(x = 0; x < GRID_FACTOR; x++) {
                                v1 = dtmf_detect_state->row_out[x].v2;
                                dtmf_detect_state->row_out[x].v2 = dtmf_detect_state->row_out[x].v3;
-                               dtmf_detect_state->row_out[x].v3 = dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp;
+                               dtmf_detect_state->row_out[x].v3 = (float)(dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp);
        
                                v1 = dtmf_detect_state->col_out[x].v2;
                                dtmf_detect_state->col_out[x].v2 = dtmf_detect_state->col_out[x].v3;
-                               dtmf_detect_state->col_out[x].v3 = dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp;
+                               dtmf_detect_state->col_out[x].v3 = (float)(dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp);
 
                                v1 = dtmf_detect_state->col_out2nd[x].v2;
                                dtmf_detect_state->col_out2nd[x].v2 = dtmf_detect_state->col_out2nd[x].v3;
-                               dtmf_detect_state->col_out2nd[x].v3 = dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp;
+                               dtmf_detect_state->col_out2nd[x].v3 = (float)(dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp);
                
                                v1 = dtmf_detect_state->row_out2nd[x].v2;
                                dtmf_detect_state->row_out2nd[x].v2 = dtmf_detect_state->row_out2nd[x].v3;
-                               dtmf_detect_state->row_out2nd[x].v3 = dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp;
+                               dtmf_detect_state->row_out2nd[x].v3 = (float)(dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp);
                        }
 
                }
index 019592ad99c6c9b81dc0bfe8a559b0cf05871dac..2545e707242a0cfdef6bc715b62b791039b32dcc 100644 (file)
@@ -2007,7 +2007,7 @@ int8_t zap_bitstream_get_bit(zap_bitstream_t *bsp)
        return bit;
 }
 
-void print_hex_bytes(uint8_t *data, zap_size_t dlen, uint8_t *buf, zap_size_t blen)
+void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen)
 {
        char *bp = buf;
        uint8_t *byte = data;
index b6f2d27b20351f360f80dd449d3d06003ceb9177..2424314b1cde0a63f46fd91a4fa47fb09e5b95eb 100644 (file)
@@ -344,7 +344,7 @@ static __inline__ void state_advance(zap_channel_t *zchan)
 #endif
                        CalledNum.TypNum = 2;
                        CalledNum.NumPlanID = 1;
-                       CalledNum.Size += strlen(zchan->caller_data.ani);
+                       CalledNum.Size = CalledNum.Size + (unsigned char)strlen(zchan->caller_data.ani);
                        gen->CalledNum = Q931AppendIE((L3UCHAR *) gen, (L3UCHAR *) &CalledNum);
                        ptrCalledNum = Q931GetIEPtr(gen->CalledNum, gen->buf);
                        zap_copy_string((char *)ptrCalledNum->Digit, zchan->caller_data.ani, strlen(zchan->caller_data.ani)+1);