History

src_sinc.c: change SHIFT_BITS sanity check into compile time assert

sezero committed 6 years ago

Commit b200f951 parent eaaab361 file · +1 −7Browse files

Unified · Split

src/src_sinc.c+1−7
@@ -38,6 +38,7 @@ · 37 unmodified lines
38 38
39typedef int32_t increment_t ;39typedef int32_t increment_t ;
40typedef float coeff_t ;40typedef float coeff_t ;
41typedef int _CHECK_SHIFT_BITS[2 * (SHIFT_BITS < sizeof (increment_t) * 8 - 1) - 1]; /* sanity check. */
41 42
42#include "fastest_coeffs.h"43#include "fastest_coeffs.h"
43#include "mid_qual_coeffs.h"44#include "mid_qual_coeffs.h"
@@ -252,13 +253,6 @@ sinc_state_new (int converter_type, int channels, SRC_ERROR *error) · 208 unmodified lines
252 assert (channels > 0) ;253 assert (channels > 0) ;
253 assert (error != NULL) ;254 assert (error != NULL) ;
254 255
255 /* Quick sanity check. */
256 if (SHIFT_BITS >= sizeof (increment_t) * 8 - 1)
257 {
258 *error = SRC_ERR_SHIFT_BITS ;
259 return NULL ;
260 }
261
262 if (channels > MAX_CHANNELS)256 if (channels > MAX_CHANNELS)
263 {257 {
264 *error = SRC_ERR_BAD_CHANNEL_COUNT ;258 *error = SRC_ERR_BAD_CHANNEL_COUNT ;

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