Skip to content

Commit

Permalink
Fixes for XCode 6 and irstats~ t30 and center bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Harker committed Feb 1, 2015
1 parent da208e4 commit 4804a93
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Config_HIRT.xcconfig
Expand Up @@ -16,7 +16,7 @@ INFOPLIST_FILE = Info.plist

// Per architecture and deployment settings

GCC_VERSION = com.apple.compilers.llvmgcc42
GCC_VERSION = com.apple.compilers.llvm.clang.1_0

// This matches with Cycling's maximum backward compatibility

Expand Down
2 changes: 2 additions & 0 deletions HISSTools_IR_Toolbox.xcodeproj/project.pbxproj
Expand Up @@ -1345,6 +1345,8 @@
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
};
buildConfigurationList = 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "HISSTools_IR_Toolbox" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
Expand Down
Expand Up @@ -10,29 +10,29 @@
<string>HISSTools_IR_Toolbox</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>D9CF29BA-BAAC-44D9-9A35-40DCFEB36130</key>
<key>1A5B1E41E0560BE65460D7FC68984C1F5ECB2A63</key>
<string>https://github.com/HISSTools/HISSTools_Impulse_Response_Toolbox.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>HISSTools_IR_Toolbox.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>D9CF29BA-BAAC-44D9-9A35-40DCFEB36130</key>
<key>1A5B1E41E0560BE65460D7FC68984C1F5ECB2A63</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/HISSTools/HISSTools_Impulse_Response_Toolbox.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>D9CF29BA-BAAC-44D9-9A35-40DCFEB36130</string>
<string>1A5B1E41E0560BE65460D7FC68984C1F5ECB2A63</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>D9CF29BA-BAAC-44D9-9A35-40DCFEB36130</string>
<string>1A5B1E41E0560BE65460D7FC68984C1F5ECB2A63</string>
<key>IDESourceControlWCCName</key>
<string>HISSTools_IR_Toolbox</string>
</dict>
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion HISSTools_IR_Toolbox_Common/HIRT_Coloured_Noise.c
Expand Up @@ -65,7 +65,7 @@ void coloured_noise_params (t_noise_params *x, t_noise_mode mode, double fade_in

// Mode

if (mode < 0 || mode > 2)
if (mode > 2)
mode = 0;

x->mode = mode;
Expand Down
2 changes: 1 addition & 1 deletion HISSTools_IR_Toolbox_Common/HIRT_Common_Attribute_Setup.h
Expand Up @@ -92,7 +92,7 @@ void fill_power_array_specifier(double *array, t_atom *specifier, long num_speci

t_max_err deconvolve_delay_setter(OBJ_CLASSNAME *x, t_object *attr, long argc, t_atom *argv)
{
if (argc && argv && atom_gettype(argv) == A_FLOAT || atom_gettype(argv) == A_LONG)
if (argc && argv && (atom_gettype(argv) == A_FLOAT || atom_gettype(argv) == A_LONG))
x->deconvolve_delay = *argv;
else
atom_setsym(&x->deconvolve_delay, gensym("center"));
Expand Down
2 changes: 1 addition & 1 deletion HISSTools_IR_Toolbox_Common/HIRT_Core_Functions.c
Expand Up @@ -282,7 +282,7 @@ void setup_hann_wind()
}


__inline double fast_hann_wind(double in)
static __inline double fast_hann_wind(double in)
{
// N.B. - in must be between 0 and 1

Expand Down
Expand Up @@ -97,7 +97,7 @@ t_convolve_error multi_channel_convolve_resize(t_multi_channel_convolve *x, AH_U
if (!x->N2M)
in_chan -= out_chan;

if (out_chan >= 0 && out_chan < x->num_out_chans)
if (out_chan < x->num_out_chans)
return output_channel_convolve_resize(x->chan_convolvers[out_chan], in_chan, impulse_length);
else
return CONVOLVE_ERR_IN_CHAN_OUT_OF_RANGE;
Expand All @@ -111,7 +111,7 @@ t_convolve_error multi_channel_convolve_set(t_multi_channel_convolve *x, AH_UInt
if (!x->N2M)
in_chan -= out_chan;

if (out_chan >= 0 && out_chan < x->num_out_chans)
if (out_chan < x->num_out_chans)
return output_channel_convolve_set(x->chan_convolvers[out_chan], in_chan, input, impulse_length, resize);
else
return CONVOLVE_ERR_OUT_CHAN_OUT_OF_RANGE;
Expand Down
Expand Up @@ -49,7 +49,7 @@ t_output_channel_convolve *output_channel_convolve_new(AH_UIntPtr input_chans, A

t_convolve_error output_channel_convolve_resize(t_output_channel_convolve *x, AH_UIntPtr in_chan, AH_UIntPtr impulse_length)
{
if (in_chan >= 0 && in_chan < x->num_in_chans)
if (in_chan < x->num_in_chans)
{
if (!zero_latency_convolve_resize(x->convolvers[in_chan], impulse_length, false))
return CONVOLVE_ERR_MEM_UNAVAILABLE;
Expand All @@ -63,7 +63,7 @@ t_convolve_error output_channel_convolve_resize(t_output_channel_convolve *x, AH

t_convolve_error output_channel_convolve_set(t_output_channel_convolve *x, AH_UIntPtr in_chan, float *input, AH_UIntPtr impulse_length, AH_Boolean resize)
{
if (in_chan >= 0 && in_chan < x->num_in_chans)
if (in_chan < x->num_in_chans)
return zero_latency_convolve_set(x->convolvers[in_chan], input, impulse_length, resize);
else
return CONVOLVE_ERR_IN_CHAN_OUT_OF_RANGE;
Expand Down
Expand Up @@ -18,7 +18,7 @@ typedef struct _output_channel_convolve

} t_output_channel_convolve;

#endif __OUTPUTCHANCONVOLVE_STRUCT__
#endif //__OUTPUTCHANCONVOLVE_STRUCT__

void output_channel_convolve_free(t_output_channel_convolve *x);
t_output_channel_convolve *output_channel_convolve_new(AH_UIntPtr input_chans, AH_UIntPtr max_length, t_convolve_latency_mode latency_mode);
Expand Down
Expand Up @@ -48,7 +48,6 @@ t_zero_latency_convolve *zero_latency_convolve_new(AH_UIntPtr max_length, t_conv
if (!x)
return 0;

latency_mode = latency_mode < 0 ? 0 : latency_mode;
latency_mode = latency_mode > 2 ? 2 : latency_mode;

switch (latency_mode)
Expand Down
12 changes: 6 additions & 6 deletions HISSTools_IR_Toolbox_Dependencies/ibuffer_access.c
Expand Up @@ -44,7 +44,7 @@ void ibuffer_init ()

#ifdef __APPLE__

__inline void convert_and_scale_int32_to_float (float *out, AH_SIntPtr n_samps)
static __inline void convert_and_scale_int32_to_float (float *out, AH_SIntPtr n_samps)
{
vFloat scale = {TWO_POW_31_RECIP, TWO_POW_31_RECIP, TWO_POW_31_RECIP, TWO_POW_31_RECIP};

Expand All @@ -67,7 +67,7 @@ __inline void convert_and_scale_int32_to_float (float *out, AH_SIntPtr n_samps)

#else

__inline void convert_and_scale_int32_to_float (float *out, AH_SIntPtr n_samps)
static __inline void convert_and_scale_int32_to_float (float *out, AH_SIntPtr n_samps)
{
vFloat scale = {TWO_POW_31_RECIP, TWO_POW_31_RECIP, TWO_POW_31_RECIP, TWO_POW_31_RECIP};

Expand Down Expand Up @@ -271,17 +271,17 @@ for (i <<= 3; i < n_samps; i++) \
for (; i < ((n_samps + 3) >> 2) << 2; i++) \
*out++ = 0;

__inline void ibuffer_fetch_samps_float (float *out, float *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
static __inline void ibuffer_fetch_samps_float (float *out, float *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
{
IBUFFER_FETCH_LOOP_UNROLL (*out++ = *(samps + *offsets++))
}

__inline void ibuffer_fetch_samps_16 (AH_SInt32 *out, AH_SInt16 *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
static __inline void ibuffer_fetch_samps_16 (AH_SInt32 *out, AH_SInt16 *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
{
IBUFFER_FETCH_LOOP_UNROLL (*out++ = (*(samps + *offsets++) << 16))
}

__inline void ibuffer_fetch_samps_24 (AH_SInt32 *out, AH_SInt8 *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
static __inline void ibuffer_fetch_samps_24 (AH_SInt32 *out, AH_SInt8 *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
{
#if (TARGET_RT_LITTLE_ENDIAN)
IBUFFER_FETCH_LOOP_UNROLL (*out++ = (*((AH_SInt32 *) ((samps - 1) + *offsets++)) & MASK_24_BIT))
Expand All @@ -290,7 +290,7 @@ __inline void ibuffer_fetch_samps_24 (AH_SInt32 *out, AH_SInt8 *samps, AH_SIntPt
#endif
}

__inline void ibuffer_fetch_samps_32 (AH_SInt32 *out, AH_SInt32 *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
static __inline void ibuffer_fetch_samps_32 (AH_SInt32 *out, AH_SInt32 *samps, AH_SIntPtr *offsets, AH_SIntPtr n_samps)
{
IBUFFER_FETCH_LOOP_UNROLL (*out++ = (*(samps + *offsets++)))
}
Expand Down
2 changes: 1 addition & 1 deletion HISSTools_IR_Toolbox_Objects/iraverage~.c
Expand Up @@ -160,7 +160,7 @@ void iraverage_process_internal (t_iraverage *x, t_symbol *sym, short argc, t_at
target = atom_getsym(argv++);
argc--;

if (argc && atom_gettype(argv) == A_LONG || atom_gettype(argv) == A_FLOAT)
if (argc && (atom_gettype(argv) == A_LONG || atom_gettype(argv) == A_FLOAT))
{
time_mul = atom_getfloat(argv++);
argc--;
Expand Down
2 changes: 1 addition & 1 deletion HISSTools_IR_Toolbox_Objects/irinvert~.c
Expand Up @@ -477,7 +477,7 @@ void irinvert_mimo_internal (t_irinvert *x, t_symbol *sym, short argc, t_atom *a
return;
}

if (argc && atom_gettype(argv) == A_LONG || atom_gettype(argv) == A_FLOAT)
if (argc && (atom_gettype(argv) == A_LONG || atom_gettype(argv) == A_FLOAT))
{
time_mul = atom_getfloat(argv++);
argc--;
Expand Down
8 changes: 4 additions & 4 deletions HISSTools_IR_Toolbox_Objects/irmeasure~.c
Expand Up @@ -167,7 +167,7 @@ void irmeasure_mls_params(t_irmeasure *x);
void irmeasure_noise_params(t_irmeasure *x);
void irmeasure_params(t_irmeasure *x);

__inline void irmeasure_perform_excitation(t_irmeasure *x, void *out, long current_t, long vec_size, AH_Boolean double_precision);
static __inline void irmeasure_perform_excitation(t_irmeasure *x, void *out, long current_t, long vec_size, AH_Boolean double_precision);
t_int *irmeasure_perform (t_int *w);
void irmeasure_perform64 (t_irmeasure *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long vec_size, long flags, void *userparam);

Expand Down Expand Up @@ -1255,15 +1255,15 @@ void irmeasure_params(t_irmeasure *x)
//////////////////////////////////////////////////////////////////////////


__inline double min_double (double v1, double v2)
static __inline double min_double (double v1, double v2)
{
v1 = v1 < v2 ? v1 : v2;

return v1;
}


__inline double max_double (double v1, double v2)
static __inline double max_double (double v1, double v2)
{
v1 = v1 > v2 ? v1 : v2;

Expand All @@ -1275,7 +1275,7 @@ __inline double max_double (double v1, double v2)
//////////////////////////////////////////////////////////////////////////


__inline void irmeasure_perform_excitation(t_irmeasure *x, void *out, long current_t, long vec_size, AH_Boolean double_precision)
static __inline void irmeasure_perform_excitation(t_irmeasure *x, void *out, long current_t, long vec_size, AH_Boolean double_precision)
{
long start;
long todo;
Expand Down
16 changes: 11 additions & 5 deletions HISSTools_IR_Toolbox_Objects/irstats~.c
Expand Up @@ -443,7 +443,7 @@ AH_SIntPtr conv_db (double *integration_db, double conv_db, AH_SIntPtr conv_pos,
break;
}

return i;
return i + 1;
}


Expand Down Expand Up @@ -908,15 +908,21 @@ double calc_clarity (double *integration, AH_SIntPtr length, double sample_rate)
}


// FIX - this doesn't seemt o work quite right...

double calc_center (double *integration, AH_SIntPtr length)
{
double time_power_integration = 0;
double weighted_sum = 0.0;
double sum = 0.0;
AH_SIntPtr i;

for (i = 0; i < length; i++)
time_power_integration += i * integration[i];
{
weighted_sum += i * integration[i];
sum += integration[i];
}

return time_power_integration / time_power_integration;
return weighted_sum / sum;
}


Expand Down Expand Up @@ -1402,7 +1408,7 @@ void irstats_stats (t_irstats *x, t_symbol *sym, short argc, t_atom *argv)
}
if (atom_getsym(argv + i) == ps_center)
{
current_stat = retrieve_T20(&stats);
current_stat = retrieve_center(&stats);
time_store(report + i, current_stat, time_mode, sample_rate);
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions HISSTools_IR_Toolbox_Objects/spectrumdraw~.c
Expand Up @@ -378,14 +378,14 @@ static __inline double bin_2_mouse(double bin, t_scale_vals *scale)
return scale->bin_scale * (bin - scale->bin_min);
}


/*
static __inline double mouse_2_bin(double x_val, t_scale_vals *scale)
{
if (scale->log_mode)
return exp((x_val / scale->bin_scale) + scale->bin_min);
else
return (x_val / scale->bin_scale) + scale->bin_min;
}
}*/


static __inline double freq_2_mouse(double freq, t_scale_vals *scale)
Expand Down Expand Up @@ -3138,7 +3138,7 @@ void spectrumdraw_paint(t_spectrumdraw *x, t_object *patcherview)
//////////////////////////////////////////////////////////////////////////


__inline t_symbol *get_attribname_symbol (char *base_string, short N)
static __inline t_symbol *get_attribname_symbol (char *base_string, short N)
{
char string_test[32];

Expand Down

0 comments on commit 4804a93

Please sign in to comment.