Browse Source

Minor clean-ups.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
7485498ee7
23 changed files with 100 additions and 186 deletions
  1. +1
    -1
      src/audio/dsp/juce_AudioDataConverters.cpp
  2. +5
    -11
      src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm
  3. +8
    -16
      src/audio/plugins/formats/juce_VSTPluginFormat.cpp
  4. +1
    -1
      src/core/juce_Time.cpp
  5. +3
    -6
      src/io/network/juce_Socket.cpp
  6. +3
    -6
      src/native/common/juce_posix_SharedCode.h
  7. +1
    -2
      src/native/linux/juce_linux_Network.cpp
  8. +7
    -15
      src/native/linux/juce_linux_Windowing.cpp
  9. +1
    -2
      src/native/mac/juce_mac_NativeCode.mm
  10. +4
    -11
      src/native/windows/juce_win32_ASIO.cpp
  11. +7
    -16
      src/native/windows/juce_win32_AudioCDReader.cpp
  12. +9
    -9
      src/native/windows/juce_win32_CameraDevice.cpp
  13. +3
    -9
      src/native/windows/juce_win32_DirectSound.cpp
  14. +5
    -9
      src/native/windows/juce_win32_FileChooser.cpp
  15. +4
    -9
      src/native/windows/juce_win32_Files.cpp
  16. +3
    -9
      src/native/windows/juce_win32_Fonts.cpp
  17. +1
    -2
      src/native/windows/juce_win32_Messaging.cpp
  18. +6
    -12
      src/native/windows/juce_win32_Midi.cpp
  19. +23
    -30
      src/native/windows/juce_win32_Network.cpp
  20. +2
    -4
      src/native/windows/juce_win32_OpenGLComponent.cpp
  21. +1
    -2
      src/native/windows/juce_win32_QuickTimeMovieComponent.cpp
  22. +1
    -2
      src/native/windows/juce_win32_WASAPI.cpp
  23. +1
    -2
      src/native/windows/juce_win32_Windowing.cpp

+ 1
- 1
src/audio/dsp/juce_AudioDataConverters.cpp View File

@@ -584,7 +584,7 @@ public:
conv = new AudioData::ConverterInstance <AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::Const>,
AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> >();
if (! inPlace)
zerostruct (reversed);
zeromem (reversed, sizeof (reversed));
conv->convertSamples (reversed, inPlace ? reversed : converted, numSamples);


+ 5
- 11
src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm View File

@@ -570,8 +570,7 @@ void AudioUnitPluginInstance::setPluginCallbacks()
if (audioUnit != 0)
{
{
AURenderCallbackStruct info;
zerostruct (info);
AURenderCallbackStruct info = { 0 };
info.inputProcRefCon = this;
info.inputProc = renderGetInputCallback;
@@ -580,8 +579,7 @@ void AudioUnitPluginInstance::setPluginCallbacks()
}
{
HostCallbackInfo info;
zerostruct (info);
HostCallbackInfo info = { 0 };
info.hostUserData = this;
info.beatAndTempoProc = getBeatAndTempoCallback;
info.musicalTimeLocationProc = getMusicalTimeLocationCallback;
@@ -630,8 +628,7 @@ void AudioUnitPluginInstance::prepareToPlay (double sampleRate_,
AudioUnitReset (audioUnit, kAudioUnitScope_Global, 0);
{
AudioStreamBasicDescription stream;
zerostruct (stream);
AudioStreamBasicDescription stream = { 0 };
stream.mSampleRate = sampleRate_;
stream.mFormatID = kAudioFormatLinearPCM;
stream.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved;
@@ -1230,8 +1227,7 @@ void AudioUnitPluginInstance::setParameter (int index, float newValue)
const String AudioUnitPluginInstance::getParameterName (int index)
{
AudioUnitParameterInfo info;
zerostruct (info);
AudioUnitParameterInfo info = { 0 };
UInt32 sz = sizeof (info);
String name;
@@ -1503,12 +1499,10 @@ const StringArray AudioUnitPluginFormat::searchPathsForPlugins (const FileSearch
{
StringArray result;
ComponentRecord* comp = 0;
ComponentDescription desc;
zerostruct (desc);
for (;;)
{
zerostruct (desc);
ComponentDescription desc = { 0 };
comp = FindNextComponent (comp, &desc);
if (comp == 0)


+ 8
- 16
src/audio/plugins/formats/juce_VSTPluginFormat.cpp View File

@@ -1267,8 +1267,7 @@ public:
{
const Rectangle<int> clip (g.getClipBounds());
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xexpose.type = Expose;
ev.xexpose.display = display;
ev.xexpose.window = pluginWindow;
@@ -1325,8 +1324,7 @@ public:
toFront (true);
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xbutton.display = display;
ev.xbutton.type = ButtonPress;
ev.xbutton.window = pluginWindow;
@@ -1646,8 +1644,7 @@ private:
{
if (pluginWindow != 0)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xcrossing.display = display;
ev.xcrossing.type = EnterNotify;
ev.xcrossing.window = pluginWindow;
@@ -1670,8 +1667,7 @@ private:
{
if (pluginWindow != 0)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xcrossing.display = display;
ev.xcrossing.type = LeaveNotify;
ev.xcrossing.window = pluginWindow;
@@ -1695,8 +1691,7 @@ private:
{
if (pluginWindow != 0)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xmotion.display = display;
ev.xmotion.type = MotionNotify;
ev.xmotion.window = pluginWindow;
@@ -1716,8 +1711,7 @@ private:
{
if (pluginWindow != 0)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xmotion.display = display;
ev.xmotion.type = MotionNotify;
ev.xmotion.window = pluginWindow;
@@ -1738,8 +1732,7 @@ private:
{
if (pluginWindow != 0)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xbutton.display = display;
ev.xbutton.type = ButtonRelease;
ev.xbutton.window = pluginWindow;
@@ -1761,8 +1754,7 @@ private:
{
if (pluginWindow != 0)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xbutton.display = display;
ev.xbutton.type = ButtonPress;
ev.xbutton.window = pluginWindow;


+ 1
- 1
src/core/juce_Time.cpp View File

@@ -97,7 +97,7 @@ namespace TimeHelpers
if (now >= 0 && now <= 0x793406fff)
localtime_s (&result, &now);
else
zeromem (&result, sizeof (result));
zerostruct (result);
#else
result = *localtime (&now);
#endif


+ 3
- 6
src/io/network/juce_Socket.cpp View File

@@ -104,8 +104,7 @@ namespace SocketHelpers
if (handle <= 0 || port <= 0)
return false;
struct sockaddr_in servTmpAddr;
zerostruct (servTmpAddr);
struct sockaddr_in servTmpAddr = { 0 };
servTmpAddr.sin_family = PF_INET;
servTmpAddr.sin_addr.s_addr = htonl (INADDR_ANY);
servTmpAddr.sin_port = htons ((uint16) port);
@@ -231,8 +230,7 @@ namespace SocketHelpers
const int portNumber,
const int timeOutMillisecs) throw()
{
struct addrinfo hints;
zerostruct (hints);
struct addrinfo hints = { 0 };
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = isDatagram ? SOCK_DGRAM : SOCK_STREAM;
hints.ai_flags = AI_NUMERICSERV;
@@ -424,8 +422,7 @@ bool StreamingSocket::createListener (const int newPortNumber, const String& loc
portNumber = newPortNumber;
isListener = true;
struct sockaddr_in servTmpAddr;
zerostruct (servTmpAddr);
struct sockaddr_in servTmpAddr = { 0 };
servTmpAddr.sin_family = PF_INET;
servTmpAddr.sin_addr.s_addr = htonl (INADDR_ANY);


+ 3
- 6
src/native/common/juce_posix_SharedCode.h View File

@@ -523,8 +523,7 @@ const String File::getVolumeLabel() const
char mountPointSpace [MAXPATHLEN];
} attrBuf;
struct attrlist attrList;
zerostruct (attrList);
struct attrlist attrList = { 0 };
attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
attrList.volattr = ATTR_VOL_INFO | ATTR_VOL_NAME;
@@ -608,8 +607,7 @@ public:
if (handle != 0)
{
struct flock fl;
zerostruct (fl);
struct flock fl = { 0 };
fl.l_whence = SEEK_SET;
fl.l_type = F_WRLCK;
@@ -645,8 +643,7 @@ public:
{
if (handle != 0)
{
struct flock fl;
zerostruct (fl);
struct flock fl = { 0 };
fl.l_whence = SEEK_SET;
fl.l_type = F_UNLCK;


+ 1
- 2
src/native/linux/juce_linux_Network.cpp View File

@@ -214,8 +214,7 @@ private:
port = hostPort;
}
struct addrinfo hints;
zerostruct (hints);
struct addrinfo hints = { 0 };
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_NUMERICSERV;


+ 7
- 15
src/native/linux/juce_linux_Windowing.cpp View File

@@ -178,8 +178,7 @@ namespace XSHMHelpers
trappedErrorCode = 0;
XErrorHandler oldHandler = XSetErrorHandler (errorTrapHandler);
XShmSegmentInfo segmentInfo;
zerostruct (segmentInfo);
XShmSegmentInfo segmentInfo = { 0 };
XImage* xImage = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)),
24, ZPixmap, 0, &segmentInfo, 50, 50);
@@ -1684,8 +1683,7 @@ public:
if (managerWin != None)
{
XEvent ev;
zerostruct (ev);
XEvent ev = { 0 };
ev.xclient.type = ClientMessage;
ev.xclient.window = managerWin;
ev.xclient.message_type = XInternAtom (display, "_NET_SYSTEM_TRAY_OPCODE", False);
@@ -2000,8 +1998,7 @@ private:
if (hints != None)
{
MotifWmHints motifHints;
zerostruct (motifHints);
MotifWmHints motifHints = { 0 };
motifHints.flags = 2; /* MWM_HINTS_DECORATIONS */
motifHints.decorations = 0;
@@ -2040,9 +2037,7 @@ private:
if (hints != None)
{
MotifWmHints motifHints;
zerostruct (motifHints);
MotifWmHints motifHints = { 0 };
motifHints.flags = 1 | 2; /* MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS */
motifHints.decorations = 2 /* MWM_DECOR_BORDER */ | 8 /* MWM_DECOR_TITLE */ | 16; /* MWM_DECOR_MENU */
@@ -2368,8 +2363,7 @@ private:
void sendDragAndDropStatus (const bool acceptDrop, Atom dropAction)
{
XClientMessageEvent msg;
zerostruct (msg);
XClientMessageEvent msg = { 0 };
msg.message_type = Atoms::XdndStatus;
msg.data.l[1] = (acceptDrop ? 1 : 0) | 2; // 2 indicates that we want to receive position messages
msg.data.l[4] = dropAction;
@@ -2379,16 +2373,14 @@ private:
void sendDragAndDropLeave()
{
XClientMessageEvent msg;
zerostruct (msg);
XClientMessageEvent msg = { 0 };
msg.message_type = Atoms::XdndLeave;
sendDragAndDropMessage (msg);
}
void sendDragAndDropFinish()
{
XClientMessageEvent msg;
zerostruct (msg);
XClientMessageEvent msg = { 0 };
msg.message_type = Atoms::XdndFinished;
sendDragAndDropMessage (msg);
}


+ 1
- 2
src/native/mac/juce_mac_NativeCode.mm View File

@@ -130,8 +130,7 @@ public:
runLoop = CFRunLoopGetCurrent();
#endif
CFRunLoopSourceContext sourceContext;
zerostruct (sourceContext);
CFRunLoopSourceContext sourceContext = { 0 };
sourceContext.info = this;
sourceContext.perform = runLoopSourceCallback;
runLoopSource = CFRunLoopSourceCreate (kCFAllocatorDefault, 1, &sourceContext);


+ 4
- 11
src/native/windows/juce_win32_ASIO.cpp View File

@@ -439,9 +439,7 @@ public:
{
inBuffers[n] = tempBuffer + (currentBlockSizeSamples * n);
ASIOChannelInfo channelInfo;
zerostruct (channelInfo);
ASIOChannelInfo channelInfo = { 0 };
channelInfo.channel = i;
channelInfo.isInput = 1;
asioObject->getChannelInfo (&channelInfo);
@@ -468,9 +466,7 @@ public:
{
outBuffers[n] = tempBuffer + (currentBlockSizeSamples * (numActiveInputChans + n));
ASIOChannelInfo channelInfo;
zerostruct (channelInfo);
ASIOChannelInfo channelInfo = { 0 };
channelInfo.channel = i;
channelInfo.isInput = 0;
asioObject->getChannelInfo (&channelInfo);
@@ -1040,12 +1036,9 @@ private:
updateSampleRates();
ASIOChannelInfo channelInfo;
channelInfo.type = 0;
for (i = 0; i < totalNumInputChans; ++i)
{
zerostruct (channelInfo);
ASIOChannelInfo channelInfo = { 0 };
channelInfo.channel = i;
channelInfo.isInput = 1;
asioObject->getChannelInfo (&channelInfo);
@@ -1055,7 +1048,7 @@ private:
for (i = 0; i < totalNumOutputChans; ++i)
{
zerostruct (channelInfo);
ASIOChannelInfo channelInfo = { 0 };
channelInfo.channel = i;
channelInfo.isInput = 0;
asioObject->getChannelInfo (&channelInfo);


+ 7
- 16
src/native/windows/juce_win32_AudioCDReader.cpp View File

@@ -329,8 +329,7 @@ void findCDDevices (Array<CDDeviceDescription>& list)
{
char buffer[100] = { 0 };
SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER p;
zerostruct (p);
SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER p = { 0 };
p.spt.Length = sizeof (SCSI_PASS_THROUGH);
p.spt.CdbLength = 6;
p.spt.SenseInfoLength = 24;
@@ -352,8 +351,7 @@ void findCDDevices (Array<CDDeviceDescription>& list)
dev.scsiDriveLetter = driveLetter;
dev.createDescription (buffer);
SCSI_ADDRESS scsiAddr;
zerostruct (scsiAddr);
SCSI_ADDRESS scsiAddr = { 0 };
scsiAddr.Length = sizeof (scsiAddr);
if (DeviceIoControl (h, IOCTL_SCSI_GET_ADDRESS,
@@ -376,9 +374,7 @@ void findCDDevices (Array<CDDeviceDescription>& list)
DWORD performScsiPassThroughCommand (SRB_ExecSCSICmd* const srb, const char driveLetter,
HANDLE& deviceHandle, const bool retryOnFailure)
{
SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER s;
zerostruct (s);
SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER s = { 0 };
s.spt.Length = sizeof (SCSI_PASS_THROUGH);
s.spt.CdbLength = srb->SRB_CDBLen;
@@ -805,8 +801,7 @@ int CDController::getLastIndex()
//==============================================================================
bool CDDeviceHandle::readTOC (TOC* lpToc)
{
SRB_ExecSCSICmd s;
zerostruct (s);
SRB_ExecSCSICmd s = { 0 };
s.SRB_Cmd = SC_EXEC_SCSI_CMD;
s.SRB_HaID = info.ha;
s.SRB_Target = info.tgt;
@@ -880,8 +875,7 @@ void CDDeviceHandle::openDrawer (bool shouldBeOpen)
}
}
SRB_ExecSCSICmd s;
zerostruct (s);
SRB_ExecSCSICmd s = { 0 };
s.SRB_Cmd = SC_EXEC_SCSI_CMD;
s.SRB_HaID = info.ha;
s.SRB_Target = info.tgt;
@@ -1138,9 +1132,7 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta
bool AudioCDReader::isCDStillPresent() const
{
using namespace CDReaderHelpers;
TOC toc;
zerostruct (toc);
TOC toc = { 0 };
return static_cast <CDDeviceWrapper*> (handle)->deviceHandle.readTOC (&toc);
}
@@ -1150,8 +1142,7 @@ void AudioCDReader::refreshTrackLengths()
trackStartSamples.clear();
zeromem (audioTracks, sizeof (audioTracks));
TOC toc;
zerostruct (toc);
TOC toc = { 0 };
if (static_cast <CDDeviceWrapper*> (handle)->deviceHandle.readTOC (&toc))
{


+ 9
- 9
src/native/windows/juce_win32_CameraDevice.cpp View File

@@ -99,12 +99,13 @@ public:
if (FAILED (hr))
return;
AM_MEDIA_TYPE mt;
zerostruct (mt);
mt.majortype = MEDIATYPE_Video;
mt.subtype = MEDIASUBTYPE_RGB24;
mt.formattype = FORMAT_VideoInfo;
sampleGrabber->SetMediaType (&mt);
{
AM_MEDIA_TYPE mt = { 0 };
mt.majortype = MEDIATYPE_Video;
mt.subtype = MEDIASUBTYPE_RGB24;
mt.formattype = FORMAT_VideoInfo;
sampleGrabber->SetMediaType (&mt);
}
callback = new GrabberCallback (*this);
hr = sampleGrabber->SetCallback (callback, 1);
@@ -123,7 +124,7 @@ public:
if (FAILED (hr))
return;
zerostruct (mt);
AM_MEDIA_TYPE mt = { 0 };
hr = sampleGrabber->GetConnectedMediaType (&mt);
VIDEOINFOHEADER* pVih = (VIDEOINFOHEADER*) (mt.pbFormat);
width = pVih->bmiHeader.biWidth;
@@ -601,8 +602,7 @@ private:
if (wantedDirection == dir)
{
PIN_INFO info;
zerostruct (info);
PIN_INFO info = { 0 };
pin->QueryPinInfo (&info);
if (pinName == 0 || String (pinName).equalsIgnoreCase (String (info.achName)))


+ 3
- 9
src/native/windows/juce_win32_DirectSound.cpp View File

@@ -292,9 +292,7 @@ public:
{
IDirectSoundBuffer* pPrimaryBuffer;
DSBUFFERDESC primaryDesc;
zerostruct (primaryDesc);
DSBUFFERDESC primaryDesc = { 0 };
primaryDesc.dwSize = sizeof (DSBUFFERDESC);
primaryDesc.dwFlags = 1 /* DSBCAPS_PRIMARYBUFFER */;
primaryDesc.dwBufferBytes = 0;
@@ -320,9 +318,7 @@ public:
if (hr == S_OK)
{
DSBUFFERDESC secondaryDesc;
zerostruct (secondaryDesc);
DSBUFFERDESC secondaryDesc = { 0 };
secondaryDesc.dwSize = sizeof (DSBUFFERDESC);
secondaryDesc.dwFlags = 0x8000 /* DSBCAPS_GLOBALFOCUS */
| 0x10000 /* DSBCAPS_GETCURRENTPOSITION2 */;
@@ -620,9 +616,7 @@ public:
wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign;
wfFormat.cbSize = 0;
DSCBUFFERDESC captureDesc;
zerostruct (captureDesc);
DSCBUFFERDESC captureDesc = { 0 };
captureDesc.dwSize = sizeof (DSCBUFFERDESC);
captureDesc.dwFlags = 0;
captureDesc.dwBufferBytes = totalBytesPerBuffer;


+ 5
- 9
src/native/windows/juce_win32_FileChooser.cpp View File

@@ -181,9 +181,7 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_
if (selectsDirectory)
{
BROWSEINFO bi;
zerostruct (bi);
BROWSEINFO bi = { 0 };
bi.hwndOwner = (HWND) parentWindow.getWindowHandle();
bi.pszDisplayName = files;
bi.lpszTitle = title.toWideCharPointer();
@@ -238,16 +236,14 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_
filter.copyToUTF16 (filters + (bytesWritten / sizeof (WCHAR)) + 1,
(filterSpaceNumChars - 1) * sizeof (WCHAR) - bytesWritten);
OPENFILENAMEW of;
zerostruct (of);
OPENFILENAMEW of = { 0 };
String localPath (info.initialPath);
#ifdef OPENFILENAME_SIZE_VERSION_400W
#ifdef OPENFILENAME_SIZE_VERSION_400W
of.lStructSize = OPENFILENAME_SIZE_VERSION_400W;
#else
#else
of.lStructSize = sizeof (of);
#endif
#endif
of.hwndOwner = (HWND) parentWindow.getWindowHandle();
of.lpstrFilter = filters.getData();
of.nFilterIndex = 1;


+ 4
- 9
src/native/windows/juce_win32_Files.cpp View File

@@ -167,8 +167,7 @@ bool File::moveToTrash() const
if (! exists())
return true;
SHFILEOPSTRUCT fos;
zerostruct (fos);
SHFILEOPSTRUCT fos = { 0 };
// The string we pass in must be double null terminated..
String doubleNullTermPath (getFullPathName() + " ");
@@ -677,8 +676,7 @@ public:
if (! connected)
{
OVERLAPPED over;
zerostruct (over);
OVERLAPPED over = { 0 };
over.hEvent = CreateEvent (0, TRUE, FALSE, 0);
@@ -765,8 +763,7 @@ int NamedPipe::read (void* destBuffer, int maxBytesToRead, int timeOutMillisecon
if (maxBytesToRead <= 0)
return 0;
OVERLAPPED over;
zerostruct (over);
OVERLAPPED over = { 0 };
over.hEvent = CreateEvent (0, TRUE, FALSE, 0);
unsigned long numRead;
@@ -820,9 +817,7 @@ int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOut
if (numBytesToWrite <= 0)
return 0;
OVERLAPPED over;
zerostruct (over);
OVERLAPPED over = { 0 };
over.hEvent = CreateEvent (0, TRUE, FALSE, 0);
unsigned long numWritten;


+ 3
- 9
src/native/windows/juce_win32_Fonts.cpp View File

@@ -51,9 +51,7 @@ static int CALLBACK wfontEnum1 (ENUMLOGFONTEXW* lpelfe,
{
if (lpelfe != 0 && (type & RASTER_FONTTYPE) == 0)
{
LOGFONTW lf;
zerostruct (lf);
LOGFONTW lf = { 0 };
lf.lfWeight = FW_DONTCARE;
lf.lfOutPrecision = OUT_OUTLINE_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
@@ -80,9 +78,7 @@ const StringArray Font::findAllTypefaceNames()
HDC dc = CreateCompatibleDC (0);
{
LOGFONTW lf;
zerostruct (lf);
LOGFONTW lf = { 0 };
lf.lfWeight = FW_DONTCARE;
lf.lfOutPrecision = OUT_OUTLINE_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
@@ -158,9 +154,7 @@ public:
SetMapperFlags (dc, 0);
SetMapMode (dc, MM_TEXT);
LOGFONTW lfw;
zerostruct (lfw);
LOGFONTW lfw = { 0 };
lfw.lfCharSet = DEFAULT_CHARSET;
lfw.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lfw.lfOutPrecision = OUT_OUTLINE_PRECIS;


+ 1
- 2
src/native/windows/juce_win32_Messaging.cpp View File

@@ -272,8 +272,7 @@ void MessageManager::doPlatformSpecificInitialisation()
HMODULE moduleHandle = (HMODULE) PlatformUtilities::getCurrentModuleInstanceHandle();
WNDCLASSEX wc;
zerostruct (wc);
WNDCLASSEX wc = { 0 };
wc.cbSize = sizeof (wc);
wc.lpfnWndProc = (WNDPROC) juce_MessageWndProc;
wc.cbWndExtra = 4;


+ 6
- 12
src/native/windows/juce_win32_Midi.cpp View File

@@ -233,8 +233,7 @@ const StringArray MidiInput::getDevices()
for (int i = 0; i < num; ++i)
{
MIDIINCAPS mc;
zerostruct (mc);
MIDIINCAPS mc = { 0 };
if (midiInGetDevCaps (i, &mc, sizeof (mc)) == MMSYSERR_NOERROR)
s.add (String (mc.szPname, sizeof (mc.szPname)));
@@ -261,8 +260,7 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call
for (int i = 0; i < num; ++i)
{
MIDIINCAPS mc;
zerostruct (mc);
MIDIINCAPS mc = { 0 };
if (midiInGetDevCaps (i, &mc, sizeof (mc)) == MMSYSERR_NOERROR)
{
@@ -341,8 +339,7 @@ const StringArray MidiOutput::getDevices()
for (int i = 0; i < num; ++i)
{
MIDIOUTCAPS mc;
zerostruct (mc);
MIDIOUTCAPS mc = { 0 };
if (midiOutGetDevCaps (i, &mc, sizeof (mc)) == MMSYSERR_NOERROR)
s.add (String (mc.szPname, sizeof (mc.szPname)));
@@ -358,8 +355,7 @@ int MidiOutput::getDefaultDeviceIndex()
for (int i = 0; i < num; ++i)
{
MIDIOUTCAPS mc;
zerostruct (mc);
MIDIOUTCAPS mc = { 0 };
if (midiOutGetDevCaps (i, &mc, sizeof (mc)) == MMSYSERR_NOERROR)
{
@@ -381,8 +377,7 @@ MidiOutput* MidiOutput::openDevice (int index)
for (i = 0; i < num; ++i)
{
MIDIOUTCAPS mc;
zerostruct (mc);
MIDIOUTCAPS mc = { 0 };
if (midiOutGetDevCaps (i, &mc, sizeof (mc)) == MMSYSERR_NOERROR)
{
@@ -502,8 +497,7 @@ void MidiOutput::sendMessageNow (const MidiMessage& message)
if (message.getRawDataSize() > 3
|| message.isSysEx())
{
MIDIHDR h;
zerostruct (h);
MIDIHDR h = { 0 };
h.lpData = (char*) message.getRawData();
h.dwBufferLength = message.getRawDataSize();


+ 23
- 30
src/native/windows/juce_win32_Network.cpp View File

@@ -227,8 +227,7 @@ private:
// break up the url..
TCHAR file[1024], server[1024];
URL_COMPONENTS uc;
zerostruct (uc);
URL_COMPONENTS uc = { 0 };
uc.dwStructSize = sizeof (uc);
uc.dwUrlPathLength = sizeof (file);
uc.dwHostNameLength = sizeof (server);
@@ -292,8 +291,7 @@ private:
if (request != 0)
{
INTERNET_BUFFERS buffers;
zerostruct (buffers);
INTERNET_BUFFERS buffers = { 0 };
buffers.dwStructSize = sizeof (INTERNET_BUFFERS);
buffers.lpcszHeader = headers.toWideCharPointer();
buffers.dwHeadersLength = headers.length();
@@ -392,39 +390,36 @@ namespace MACAddressHelpers
if (NetbiosCall != 0)
{
NCB ncb;
zerostruct (ncb);
LANA_ENUM enums = { 0 };
struct ASTAT
{
ADAPTER_STATUS adapt;
NAME_BUFFER NameBuff [30];
};
ASTAT astat;
zeromem (&astat, sizeof (astat)); // (can't use zerostruct here in VC6)
LANA_ENUM enums;
zerostruct (enums);
ncb.ncb_command = NCBENUM;
ncb.ncb_buffer = (unsigned char*) &enums;
ncb.ncb_length = sizeof (LANA_ENUM);
NetbiosCall (&ncb);
NCB ncb = { 0 };
ncb.ncb_command = NCBENUM;
ncb.ncb_buffer = (unsigned char*) &enums;
ncb.ncb_length = sizeof (LANA_ENUM);
NetbiosCall (&ncb);
}
for (int i = 0; i < enums.length; ++i)
{
zerostruct (ncb);
ncb.ncb_command = NCBRESET;
ncb.ncb_lana_num = enums.lana[i];
NCB ncb2 = { 0 };
ncb2.ncb_command = NCBRESET;
ncb2.ncb_lana_num = enums.lana[i];
if (NetbiosCall (&ncb) == 0)
if (NetbiosCall (&ncb2) == 0)
{
zerostruct (ncb);
NCB ncb = { 0 };
memcpy (ncb.ncb_callname, "* ", NCBNAMSZ);
ncb.ncb_command = NCBASTAT;
ncb.ncb_lana_num = enums.lana[i];
struct ASTAT
{
ADAPTER_STATUS adapt;
NAME_BUFFER NameBuff [30];
};
ASTAT astat = { 0 };
ncb.ncb_buffer = (unsigned char*) &astat;
ncb.ncb_length = sizeof (ASTAT);
@@ -457,13 +452,11 @@ bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAdd
if (mapiSendMail != 0)
{
MapiMessage message;
zerostruct (message);
MapiMessage message = { 0 };
message.lpszSubject = (LPSTR) emailSubject.toUTF8().getAddress();
message.lpszNoteText = (LPSTR) bodyText.toUTF8().getAddress();
MapiRecipDesc recip;
zerostruct (recip);
MapiRecipDesc recip = { 0 };
recip.ulRecipClass = MAPI_TO;
String targetEmailAddress_ (targetEmailAddress);
if (targetEmailAddress_.isEmpty())


+ 2
- 4
src/native/windows/juce_win32_OpenGLComponent.cpp View File

@@ -89,8 +89,7 @@ public:
createNativeWindow();
// Use a default pixel format that should be supported everywhere
PIXELFORMATDESCRIPTOR pfd;
zerostruct (pfd);
PIXELFORMATDESCRIPTOR pfd = { 0 };
pfd.nSize = sizeof (pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
@@ -167,8 +166,7 @@ public:
{
makeActive();
PIXELFORMATDESCRIPTOR pfd;
zerostruct (pfd);
PIXELFORMATDESCRIPTOR pfd = { 0 };
pfd.nSize = sizeof (pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;


+ 1
- 2
src/native/windows/juce_win32_QuickTimeMovieComponent.cpp View File

@@ -375,8 +375,7 @@ bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle
dataHandle = 0;
bool ok = false;
QTNewMoviePropertyElement props[5];
zeromem (props, sizeof (props));
QTNewMoviePropertyElement props[5] = { 0 };
int prop = 0;
DataReferenceRecord dr;


+ 1
- 2
src/native/windows/juce_win32_WASAPI.cpp View File

@@ -330,8 +330,7 @@ private:
bool tryInitialisingWithFormat (const bool useFloat, const int bytesPerSampleToTry)
{
WAVEFORMATEXTENSIBLE format;
zerostruct (format);
WAVEFORMATEXTENSIBLE format = { 0 };
if (numChannels <= 2 && bytesPerSampleToTry <= 2)
{


+ 1
- 2
src/native/windows/juce_win32_Windowing.cpp View File

@@ -1041,8 +1041,7 @@ private:
GetModuleFileName (moduleHandle, moduleFile, 1024);
WORD iconNum = 0;
WNDCLASSEX wcex;
zerostruct (wcex);
WNDCLASSEX wcex = { 0 };
wcex.cbSize = sizeof (wcex);
wcex.style = CS_OWNDC;
wcex.lpfnWndProc = (WNDPROC) windowProc;


Loading…
Cancel
Save