History

Make use of C99 bool type

evpobr committed 6 years ago

Commit 4ff9f4a1 parent ece92456 files · +13 −5Browse files

Unified · Split

6 files
  1. CMakeLists.txt +1 −0
  2. config.h.in +3 −0
  3. configure.ac +1 −0
  4. src/common.h +3 −0
  5. src/src_linear.c +2 −2
  6. src/src_zoh.c +3 −3
CMakeLists.txt+1−0
@@ -92,6 +92,7 @@ clip_mode() · 91 unmodified lines
92check_function_exists(alarm HAVE_ALARM)92check_function_exists(alarm HAVE_ALARM)
93check_function_exists(signal HAVE_SIGNAL)93check_function_exists(signal HAVE_SIGNAL)
94 94
95check_include_file(stdbool.h HAVE_STDBOOL_H)
95check_include_file(sys/times.h HAVE_SYS_TIMES_H)96check_include_file(sys/times.h HAVE_SYS_TIMES_H)
96check_include_file(unistd.h HAVE_UNISTD_H)97check_include_file(unistd.h HAVE_UNISTD_H)
97 98
config.h.in+3−0
@@ -48,6 +48,9 @@ · 47 unmodified lines
48/* Set to 1 if you have libsndfile. */48/* Set to 1 if you have libsndfile. */
49#cmakedefine01 HAVE_SNDFILE49#cmakedefine01 HAVE_SNDFILE
50 50
51/* Define to 1 if you have the <stdbool.h> header file. */
52#cmakedefine HAVE_STDBOOL_H
53
51/* Define to 1 if you have the <stdint.h> header file. */54/* Define to 1 if you have the <stdint.h> header file. */
52#cmakedefine01 HAVE_STDINT_H55#cmakedefine01 HAVE_STDINT_H
53 56
configure.ac+1−0
@@ -87,6 +87,7 @@ AS_IF([test "x${build_os}${host_os}" = "xmingw32mingw32"], [ · 86 unmodified lines
87 ])87 ])
88 88
89AC_HEADER_STDC89AC_HEADER_STDC
90AC_HEADER_STDBOOL
90 91
91AC_CHECK_HEADERS([stdint.h sys/times.h])92AC_CHECK_HEADERS([stdint.h sys/times.h])
92 93
src/common.h+3−0
@@ -10,6 +10,9 @@ · 9 unmodified lines
10#define COMMON_H_INCLUDED10#define COMMON_H_INCLUDED
11 11
12#include <stdint.h>12#include <stdint.h>
13#ifdef HAVE_STDBOOL_H
14#include <stdbool.h>
15#endif
13 16
14#include <math.h>17#include <math.h>
15 18
src/src_linear.c+2−2
@@ -55,7 +55,7 @@ linear_vari_process (SRC_STATE *state, SRC_DATA *data) · 54 unmodified lines
55 { /* If we have just been reset, set the last_value data. */55 { /* If we have just been reset, set the last_value data. */
56 for (ch = 0 ; ch < priv->channels ; ch++)56 for (ch = 0 ; ch < priv->channels ; ch++)
57 priv->last_value [ch] = data->data_in [ch] ;57 priv->last_value [ch] = data->data_in [ch] ;
58 priv->dirty = 1 ;58 priv->dirty = true ;
59 } ;59 } ;
60 60
61 priv->in_count = data->input_frames * priv->channels ;61 priv->in_count = data->input_frames * priv->channels ;
@@ -203,7 +203,7 @@ linear_reset (SRC_STATE *state) · 141 unmodified lines
203 return ;203 return ;
204 204
205 priv->channels = state->channels ;205 priv->channels = state->channels ;
206 priv->dirty = 0 ;206 priv->dirty = false ;
207 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;207 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
208 208
209 return ;209 return ;
src/src_zoh.c+3−3
@@ -26,7 +26,7 @@ static int zoh_copy (SRC_STATE *from, SRC_STATE *to) ; · 25 unmodified lines
26typedef struct26typedef struct
27{ int zoh_magic_marker ;27{ int zoh_magic_marker ;
28 int channels ;28 int channels ;
29 int dirty ;29 bool dirty ;
30 long in_count, in_used ;30 long in_count, in_used ;
31 long out_count, out_gen ;31 long out_count, out_gen ;
32 float last_value [] ;32 float last_value [] ;
@@ -53,7 +53,7 @@ zoh_vari_process (SRC_STATE *state, SRC_DATA *data) · 20 unmodified lines
53 { /* If we have just been reset, set the last_value data. */53 { /* If we have just been reset, set the last_value data. */
54 for (ch = 0 ; ch < priv->channels ; ch++)54 for (ch = 0 ; ch < priv->channels ; ch++)
55 priv->last_value [ch] = data->data_in [ch] ;55 priv->last_value [ch] = data->data_in [ch] ;
56 priv->dirty = 1 ;56 priv->dirty = true ;
57 } ;57 } ;
58 58
59 priv->in_count = data->input_frames * priv->channels ;59 priv->in_count = data->input_frames * priv->channels ;
@@ -194,7 +194,7 @@ zoh_reset (SRC_STATE *state) · 134 unmodified lines
194 return ;194 return ;
195 195
196 priv->channels = state->channels ;196 priv->channels = state->channels ;
197 priv->dirty = 0 ;197 priv->dirty = false ;
198 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;198 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
199 199
200 return ;200 return ;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t