Skip to content

Commit 1adc072

Browse files
committed
adopt language guidance from the INCITS Inclusive Terminology Guidelines
1 parent 469d79a commit 1adc072

19 files changed

+86
-73
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ distribute the source package in order to be in compliance with the
2626
license (see the file COPYING for full license terms).
2727

2828
This software comes with no warranty (see the file COPYING). In fact,
29-
it is likely that some of these crazy effects could crash hosts (by
29+
it is likely that some of these unusual effects could crash hosts (by
3030
sending out-of-range samples or taking too much time to process), so
3131
you should be careful to save your work when using them in important
3232
songs. Tom uses Cakewalk on the PC, and Sophia uses Logic on the Mac,
@@ -75,7 +75,7 @@ features the possibility for extreme settings and MIDI control.
7575

7676
### geometer/
7777

78-
A laboratory for waveform geometry. All sorts of crazy effects are
78+
A laboratory for waveform geometry. All sorts of weird effects are
7979
possible with this thing, and sports a neat visual display of what's
8080
happening to your sound.
8181

@@ -138,7 +138,7 @@ testing:
138138
### brokenfft/
139139

140140
One of Tom's favorite plugins; this converts to the frequency domain
141-
using the FFT, and then does a number of crazy effects. It has an
141+
using the FFT, and then does a number of unusual effects. It has an
142142
almost limitless variety of sounds that will come out of it...
143143

144144

dfx-library/dfx-au-utilities-preset-files.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ CFPropertyListRef CreatePropertyListFromXMLFile(CFURLRef inXMLFileURL, SInt32* o
514514
CFErrorRef error = NULL;
515515

516516
// allow a null input for outErrorCode, and just point it to something, for safety
517-
SInt32 dummyErrorCode;
517+
SInt32 ignoredErrorCode = 0;
518518
if (outErrorCode == NULL)
519519
{
520-
outErrorCode = &dummyErrorCode;
520+
outErrorCode = &ignoredErrorCode;
521521
}
522522
*outErrorCode = noErr;
523523

@@ -569,11 +569,11 @@ SInt32 GetDictionarySInt32Value(CFDictionaryRef inAUStateDictionary, CFStringRef
569569
{
570570
CFNumberRef cfNumber = NULL;
571571
SInt32 numberValue = 0;
572-
Boolean dummySuccess;
572+
Boolean ignoredSuccess = false;
573573

574574
if (outSuccess == NULL)
575575
{
576-
outSuccess = &dummySuccess;
576+
outSuccess = &ignoredSuccess;
577577
}
578578
if ((inAUStateDictionary == NULL) || (inDictionaryKey == NULL))
579579
{
@@ -703,9 +703,9 @@ OSStatus SaveAUStateToPresetFile_Bundle(AudioComponentInstance inAUComponentInst
703703
{
704704
OSStatus status = noErr;
705705

706-
HFSUniStr255 dummyUniName;
707706
// get the absolute maximum length that a file name can be
708-
size_t const maxUnicodeNameLength = sizeof(dummyUniName.unicode) / sizeof(UniChar);
707+
HFSUniStr255 const placeholderUniName;
708+
size_t const maxUnicodeNameLength = sizeof(placeholderUniName.unicode) / sizeof(UniChar);
709709
// this is how much longer the file name will be after the AU preset file name extension is appended
710710
CFIndex const presetFileNameExtensionLength = CFStringGetLength(kAUPresetFileNameExtension) + 1; // +1 for the period before the extension
711711
// this is the maximum allowable length of the preset file's name without the extension

dfx-library/dfxmidi.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ void DfxMidi::setLegatoMode(bool inEnable)
482482
if (std::exchange(mLegatoMode, inEnable) != inEnable)
483483
{
484484
// if we have just entered legato mode, we must end any active notes so that
485-
// they don't hang in legato mode (which ignores note-offs)
485+
// they don't remain stuck in legato mode (which ignores note-offs)
486486
if (inEnable)
487487
{
488488
for (int noteIndex = 0; noteIndex < kNumNotes; noteIndex++)
@@ -598,8 +598,9 @@ bool DfxMidi::incNumEvents()
598598
// TODO: actually truncating capacity by one event because of the way that events are added, could be fixed
599599
if (mNumBlockEvents >= static_cast<long>(mBlockEvents.size()))
600600
{
601+
// revert and bail
601602
mNumBlockEvents = static_cast<long>(mBlockEvents.size()) - 1;
602-
return false; // ! abort !
603+
return false;
603604
}
604605
return true; // successful increment
605606
}

dfx-library/dfxmisc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ size_t StrlCat(char* buf, std::string_view appendme, size_t maxlen)
106106
}
107107

108108
//------------------------------------------------------
109-
// adapted from Darwin https://github.com/apple/darwin-xnu/blob/master/osfmk/arm/strlcpy.c
109+
// adapted from Darwin https://github.com/apple/darwin-xnu/blob/main/osfmk/arm/strlcpy.c
110110
size_t StrLCpy(char* dst, std::string_view src, size_t maxlen)
111111
{
112112
if ((src.size() + 1) < maxlen)

dfx-library/dfxplugin-audiounit.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,8 @@ OSStatus DfxPlugin::GetParameterInfo(AudioUnitScope inScope,
10481048
// then make sure to only copy as much as the ParameterInfo name C string can hold
10491049
strlcpy(outParameterInfo.name, getparametername(inParameterID).c_str(), std::size(outParameterInfo.name));
10501050
// in case the parameter name was dfx::kParameterNameMaxLength or longer,
1051-
// make sure that the ParameterInfo name string is terminated
1052-
outParameterInfo.name[sizeof(outParameterInfo.name) - 1] = 0;
1051+
// make sure that the ParameterInfo name string is nul-terminated
1052+
outParameterInfo.name[sizeof(outParameterInfo.name) - 1] = '\0';
10531053
//
10541054
outParameterInfo.cfNameString = getparametercfname(inParameterID);
10551055
outParameterInfo.minValue = getparametermin_f(inParameterID);
@@ -1449,7 +1449,7 @@ OSStatus DfxPlugin::SaveState(CFPropertyListRef* outData)
14491449
OSStatus DfxPlugin::RestoreState(CFPropertyListRef inData)
14501450
{
14511451
auto const status = TARGET_API_BASE_CLASS::RestoreState(inData);
1452-
// abort if the base implementation of RestoreState failed
1452+
// bail if the base implementation of RestoreState failed
14531453
if (status != noErr)
14541454
{
14551455
return status;

dfx-library/dfxplugin-base.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ To contact the author, use the contact form at http://destroyfx.org/
115115
// end of target API check
116116

117117

118-
// Now, sanity check defines.
118+
// Now, consistency check defines.
119119

120120
// Some preprocessor defines are meant to be used with "ifdef" (TARGET_API_*)
121121
// and others are meant to be defined to 1/0. Test that these are configured
@@ -224,8 +224,8 @@ enum
224224
constexpr long kParameterShortNameMax_RTAS = 4; // XXX hack (this just happens to be what I've been doing)
225225
constexpr long kParameterValueShortNameMax_RTAS = 6; // XXX hack
226226

227-
constexpr long kParameterID_RTASMasterBypass = 1;
228-
constexpr long kParameterID_RTASOffset = kParameterID_RTASMasterBypass + 1;
227+
constexpr long kParameterID_RTASGlobalBypass = 1;
228+
constexpr long kParameterID_RTASOffset = kParameterID_RTASGlobalBypass + 1;
229229
//-----------------------------------------------------------------------------
230230
constexpr long ParameterID_ToRTAS(long inParameterID)
231231
{

dfx-library/dfxplugin-rtas.cpp

+23-15
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ void DfxPlugin::DoTokenIdle()
144144
//-----------------------------------------------------------------------------
145145
void DfxPlugin::AddParametersToList()
146146
{
147-
constexpr OSType masterBypassFourCharID = 'bypa';
147+
constexpr OSType globalBypassFourCharID = FOURCC('b', 'y', 'p', 'a');
148148

149-
AddControl(new CPluginControl_OnOff(masterBypassFourCharID, "Master Bypass\nM Bypass\nMByp\nByp", false, true));
150-
DefineMasterBypassControlIndex(dfx::kParameterID_RTASMasterBypass);
149+
AddControl(new CPluginControl_OnOff(globalBypassFourCharID, "Global Bypass\nG Bypass\nGByp\nByp", false, true));
150+
DefineMasterBypassControlIndex(dfx::kParameterID_RTASGlobalBypass);
151151

152152
OSType paramFourCharID = 0;
153153
for (long i = 0; i < getnumparameters(); i++)
@@ -162,9 +162,11 @@ void DfxPlugin::AddParametersToList()
162162
auto const paramName = getparametername(i);
163163

164164
paramFourCharID = DFX_IterateAlphaNumericFourCharCode(paramFourCharID);
165-
// make sure to skip over the ID already used for master bypass
166-
if (paramFourCharID == masterBypassFourCharID)
165+
// make sure to skip over the ID already used for global bypass
166+
if (paramFourCharID == globalBypassFourCharID)
167+
{
167168
paramFourCharID = DFX_IterateAlphaNumericFourCharCode(paramFourCharID);
169+
}
168170
bool const paramAutomatable = (getparameterattributes(i) & (DfxParam::kAttribute_Hidden | DfxParam::kAttribute_Unused)) ? false : true;
169171
constexpr int numCurvedSteps = 1000;
170172
double const stepSize_default = (paramMax_f - paramMin_f) / (double)numCurvedSteps;
@@ -262,7 +264,7 @@ ComponentResult DfxPlugin::GetControlNameOfLength(long inParameterIndex, char *
262264
if (inNameLength <= dfx::kParameterShortNameMax_RTAS)
263265
{
264266
char * shortNameString = NULL;
265-
if (inParameterIndex == dfx::kParameterID_RTASMasterBypass)
267+
if (inParameterIndex == dfx::kParameterID_RTASGlobalBypass)
266268
shortNameString = "Bypass"; // any shortened version of this is fine
267269
else
268270
shortNameString = GetParameterShortName( dfx::ParameterID_FromRTAS(inParameterIndex) );
@@ -306,9 +308,9 @@ ComponentResult DfxPlugin::GetValueString(long inParameterIndex, long inValue, S
306308
//-----------------------------------------------------------------------------
307309
void DfxPlugin::UpdateControlValueInAlgorithm(long inParameterIndex)
308310
{
309-
if (inParameterIndex == dfx::kParameterID_RTASMasterBypass)
311+
if (inParameterIndex == dfx::kParameterID_RTASGlobalBypass)
310312
{
311-
mMasterBypass_rtas = dynamic_cast<CPluginControl_Discrete*>(GetControl(inParameterIndex))->GetDiscrete();
313+
mGlobalBypass_rtas = dynamic_cast<CPluginControl_Discrete*>(GetControl(inParameterIndex))->GetDiscrete();
312314
return;
313315
}
314316

@@ -363,7 +365,7 @@ ComponentResult DfxPlugin::IsControlAutomatable(long inControlIndex, short * out
363365
return paramErr;
364366

365367
// XXX test this first, since dfx::ParameterID_FromRTAS() makes it an invalid ID
366-
if (inControlIndex == dfx::kParameterID_RTASMasterBypass)
368+
if (inControlIndex == dfx::kParameterID_RTASGlobalBypass)
367369
{
368370
*outItIs = 1;
369371
return noErr;
@@ -439,7 +441,7 @@ ComponentResult DfxPlugin::SetChunk(OSType inChunkID, SFicPlugInChunk * chunk)
439441

440442
#ifdef TARGET_API_AUDIOSUITE
441443
//-----------------------------------------------------------------------------
442-
UInt32 DfxPlugin::ProcessAudio(bool inIsMasterBypassed)
444+
UInt32 DfxPlugin::ProcessAudio(bool inIsGlobalBypassed)
443445
{
444446
if (!IsAS())
445447
{
@@ -478,7 +480,7 @@ UInt32 DfxPlugin::ProcessAudio(bool inIsMasterBypassed)
478480
mInputAudioStreams_as[ch] = mZeroAudioBuffer.data();
479481
}
480482

481-
if (inIsMasterBypassed)
483+
if (inIsGlobalBypassed)
482484
{
483485
for (long i = 0; i < totalInputSamples; i++)
484486
mOutputAudioStreams_as[ch][i] = mInputAudioStreams_as[ch][i];
@@ -490,8 +492,10 @@ UInt32 DfxPlugin::ProcessAudio(bool inIsMasterBypassed)
490492
}
491493
}
492494

493-
if (!inIsMasterBypassed)
495+
if (!inIsGlobalBypassed)
496+
{
494497
RenderAudio(mInputAudioStreams_as.data(), mOutputAudioStreams_as.data(), totalInputSamples);
498+
}
495499

496500
// Get the current number of samples analyzed and pass this info
497501
// back to the DAE application so it knows how much we've processed.
@@ -539,7 +543,7 @@ void DfxPlugin::RenderAudio(float ** inAudioStreams, float ** outAudioStreams, l
539543
{
540544
continue;
541545
}
542-
if (mMasterBypass_rtas)
546+
if (mGlobalBypass_rtas)
543547
{
544548
SInt32 const inputChannelIndex = (GetNumInputs() < GetNumOutputs()) ? (GetNumInputs() - 1) : channel;
545549
std::copy_n(mInputAudioStreams[inputChannelIndex], dfx::math::ToIndex(inNumFramesToProcess), outAudioStreams[channel]);
@@ -568,7 +572,7 @@ void DfxPlugin::RenderAudio(float ** inAudioStreams, float ** outAudioStreams, l
568572
}
569573
}
570574
#if !TARGET_PLUGIN_USES_DSPCORE
571-
if (!mMasterBypass_rtas)
575+
if (!mGlobalBypass_rtas)
572576
{
573577
processaudio(const_cast<float const* const*>(mInputAudioStreams.data()), const_cast<float* const*>(outAudioStreams), (unsigned)inNumFramesToProcess);
574578
}
@@ -781,11 +785,15 @@ void DfxPlugin::ProcessDoIdle()
781785
//-----------------------------------------------------------------------------
782786
ComponentResult DfxPlugin::SetControlHighliteInfo(long inControlIndex, short inIsHighlighted, short inColor)
783787
{
784-
if (inControlIndex == dfx::kParameterID_RTASMasterBypass)
788+
if (inControlIndex == dfx::kParameterID_RTASGlobalBypass)
789+
{
785790
CProcess::SetControlHighliteInfo(inControlIndex, inIsHighlighted, inColor);
791+
}
786792

787793
if (mCustomUI_p)
794+
{
788795
mCustomUI_p->SetControlHighlight(inControlIndex, inIsHighlighted, inColor);
796+
}
789797

790798
return noErr;
791799
}

dfx-library/dfxplugin-vst.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ bool DfxPlugin::getParameterProperties(VstInt32 index, VstParameterProperties* p
410410
*properties = {};
411411

412412
// note that kVstMax* are specified as "number of characters excluding the null terminator",
413-
// and vst_strncpy behaves accordingly and terminates at array[N], however the static arrays
413+
// and vst_strncpy behaves accordingly and writes null at array[N], however the static arrays
414414
// in struct types (like VstParameterProperties here) size the arrays by N, meaning that
415415
// array[N] is out of range, so we call vst_strncpy in these cases passing N-1 as max length
416416
vst_strncpy(properties->label, getparametername(index).c_str(), kVstMaxLabelLen - 1);

dfx-library/dfxplugin.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ class DfxPlugin : public TARGET_API_BASE_CLASS
878878

879879
#ifdef TARGET_API_RTAS
880880
void AddParametersToList();
881-
bool mMasterBypass_rtas = false;
881+
bool mGlobalBypass_rtas = false;
882882
std::vector<float*> mInputAudioStreams_as;
883883
std::vector<float*> mOutputAudioStreams_as;
884884
std::vector<float> mZeroAudioBuffer;
@@ -1107,7 +1107,7 @@ class DfxPlugin : public TARGET_API_BASE_CLASS
11071107
#ifdef TARGET_API_RTAS
11081108
void EffectInit() override;
11091109
#ifdef TARGET_API_AUDIOSUITE
1110-
UInt32 ProcessAudio(bool inIsMasterBypassed) override;
1110+
UInt32 ProcessAudio(bool inIsGlobalBypassed) override;
11111111
#endif
11121112
void RenderAudio(float** inAudioStreams, float** outAudioStreams, long inNumFramesToProcess) override;
11131113
#endif

dfx-library/dfxsettings.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ bool DfxSettings::restore(void const* inData, size_t inBufferSize, bool inIsPres
303303
crisisFlags = crisisFlags | kCrisisReasonFlag_MorePresets;
304304
}
305305
}
306-
// handle the crisis situations (if any) and abort loading if we're told to
307-
if (handleCrisis(crisisFlags) == CrisisError::AbortError)
306+
// handle the crisis situations (if any) and stop trying to load if we're told to
307+
if (handleCrisis(crisisFlags) == CrisisError::QuitError)
308308
{
309309
return false;
310310
}
@@ -1141,12 +1141,12 @@ void DfxSettings::assignParam(long inParamTag, dfx::MidiEventType inEventType, l
11411141
long inEventNum2, dfx::MidiEventBehaviorFlags inEventBehaviorFlags,
11421142
long inDataInt1, long inDataInt2, float inDataFloat1, float inDataFloat2)
11431143
{
1144-
// abort if the parameter index is not valid
1144+
// bail if the parameter index is not valid
11451145
if (!paramTagIsValid(inParamTag))
11461146
{
11471147
return;
11481148
}
1149-
// abort if inEventNum is not a valid MIDI value
1149+
// bail if inEventNum is not a valid MIDI value
11501150
if ((inEventNum < 0) || (inEventNum > DfxMidi::kMaxValue))
11511151
{
11521152
return;
@@ -1459,7 +1459,7 @@ DfxSettings::CrisisError DfxSettings::handleCrisis(CrisisReasonFlags inFlags)
14591459
return CrisisError::NoError;
14601460

14611461
case CrisisBehavior::DontLoad:
1462-
return CrisisError::AbortError;
1462+
return CrisisError::QuitError;
14631463

14641464
case CrisisBehavior::LoadButComplain:
14651465
crisisAlert(inFlags);

dfx-library/dfxsettings.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ class DfxSettings
182182
// - - - - - - - - - version compatibility management - - - - - - - - -
183183

184184
// if you set this to something and data is received during restore()
185-
// which has a version number in its header that's lower than this,
186-
// then loading will abort
185+
// which has a version number in its header that is lower than this,
186+
// then loading will fail
187187
void setLowestLoadableVersion(long inVersion) noexcept
188188
{
189189
mSettingsInfo.mLowestLoadableVersion = inVersion;
@@ -305,7 +305,7 @@ class DfxSettings
305305
{
306306
// crisis-handling errors
307307
NoError,
308-
AbortError,
308+
QuitError,
309309
ComplainError,
310310
FailedCrashError
311311
};

dfxgui/dfxgui-fontfactory.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ std::optional<std::string> InstallFontWin32(const char *resource_name) {
124124
return {};
125125
}
126126
if (bytes_written != rsize) {
127-
// (Sanity checking; WriteFile should have returned false.)
127+
// (Consistency checking; WriteFile should have returned false.)
128128
return {};
129129
}
130130

@@ -220,7 +220,7 @@ class FFImpl : public FontFactory {
220220
// Register any fonts located within our plugin bundle resources.
221221
// The registration occurs locally for the process, and thus need
222222
// only occur once and requires no clean up, as that will happen
223-
// automatically upon process termination. All current and future
223+
// automatically upon process exit. All current and future
224224
// instances of the plugin in that process will have access to the
225225
// fonts registered here.
226226
static std::once_flag once;

dfxgui/dfxguitextdisplay.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ bool DGTextDisplay::valueToTextProc_LinearToDb(float inValue, char outTextUTF8[]
247247

248248
auto const decibelValue = dfx::math::Linear2dB(inValue);
249249
auto precisionOffset = reinterpret_cast<intptr_t>(inPrecisionOffset); // HACK :(
250-
precisionOffset = (std::abs(precisionOffset) > 15) ? 0 : precisionOffset; // sanity check to avert misuse with actual pointer
250+
precisionOffset = (std::abs(precisionOffset) > 15) ? 0 : precisionOffset; // reasonable range check to avert misuse with actual pointer
251251
auto const prefix = (decibelValue >= (0.01f / std::pow(10.f, precisionOffset))) ? "+" : "";
252252
int precision = (std::fabs(decibelValue) >= 100.0f) ? 0 : ((std::fabs(decibelValue) >= 10.0f) ? 1 : 2);
253253
precision = std::max(precision + static_cast<int>(precisionOffset), 0);

0 commit comments

Comments
 (0)