Skip to content

Commit 516971f

Browse files
livecodefraserpeter-b
authored andcommitted
Add using std::nothrow; to core.h
All uses of new now consistently use (nothrow) as the placement parameter instead of mixing it with (std::nothrow).
1 parent 0b3b907 commit 516971f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

libbrowser/src/libbrowser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include <core.h>
1818

19-
#include <new>
2019
#include <stdlib.h>
2120
#include <memory.h>
2221

@@ -465,7 +464,7 @@ bool MCBrowserSetRequestHandler(MCBrowserRef p_browser, MCBrowserRequestCallback
465464
}
466465

467466
MCBrowserEventHandlerWrapper *t_wrapper;
468-
t_wrapper = new (std::nothrow) MCBrowserEventHandlerWrapper(p_callback, p_context);
467+
t_wrapper = new (nothrow) MCBrowserEventHandlerWrapper(p_callback, p_context);
469468

470469
if (t_wrapper == nil)
471470
return false;
@@ -510,7 +509,7 @@ bool MCBrowserSetJavaScriptHandler(MCBrowserRef p_browser, MCBrowserJavaScriptCa
510509
}
511510

512511
MCBrowserJavaScriptHandlerWrapper *t_wrapper;
513-
t_wrapper = new (std::nothrow) MCBrowserJavaScriptHandlerWrapper(p_callback, p_context);
512+
t_wrapper = new (nothrow) MCBrowserJavaScriptHandlerWrapper(p_callback, p_context);
514513

515514
if (t_wrapper == nil)
516515
return false;

libbrowser/src/libbrowser_value.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ MC_BROWSER_DLLEXPORT_DEF
414414
bool MCBrowserListCreate(MCBrowserListRef &r_browser, uint32_t p_size)
415415
{
416416
MCBrowserList *t_browser;
417-
t_browser = new (std::nothrow) MCBrowserList();
417+
t_browser = new (nothrow) MCBrowserList();
418418
if (t_browser == nil)
419419
return false;
420420

@@ -878,7 +878,7 @@ MC_BROWSER_DLLEXPORT_DEF
878878
bool MCBrowserDictionaryCreate(MCBrowserDictionaryRef &r_dict, uint32_t p_size)
879879
{
880880
MCBrowserDictionary *t_dict;
881-
t_dict = new (std::nothrow) MCBrowserDictionary();
881+
t_dict = new (nothrow) MCBrowserDictionary();
882882
if (t_dict == nil)
883883
return false;
884884

libcore/include/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ void MCMemoryDelete(void *p_record);
282282
//////////
283283

284284
#include <new>
285+
using std::nothrow;
285286

286287
// This method provides type-safe construction of an object.
287288
template<typename T> bool MCMemoryNew(T*& r_record)

revbrowser/src/revbrowser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ bool BrowserInstances::FindInstanceById(int p_id, BrowserInstance *&r_instance)
151151
void BrowserInstances::Add(CWebBrowserBase *p_browser, bool p_is_xbrowser)
152152
{
153153
BrowserInstance *t_instance;
154-
t_instance = new (std::nothrow) BrowserInstance;
154+
t_instance = new (nothrow) BrowserInstance;
155155
t_instance -> next = m_instances;
156156
t_instance -> instance_id = ++m_last_instance_id;
157157
t_instance -> stack_id = NULL;

revvideograbber/src/revvideograbber.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct MYBITMAP
115115

116116
MYBITMAP *createmybitmap(uint2 depth, uint2 width, uint2 height)
117117
{
118-
MYBITMAP *image = new (std::nothrow) MYBITMAP;
118+
MYBITMAP *image = new (nothrow) MYBITMAP;
119119
image->width = width;
120120
image->height = height;
121121
image->depth = (uint1)depth;
@@ -638,7 +638,7 @@ void REVVideoGrabber(VideoGrabberKeyword whichkeyword,
638638
{
639639
#endif
640640
if (InitQT())
641-
gvideograbber = new (std::nothrow) CQTVideoGrabber(windowid);
641+
gvideograbber = new (nothrow) CQTVideoGrabber(windowid);
642642
else
643643
{
644644
// SN-2015-04-17: [[ Bug 13452 ]] Break if qvideograbber

0 commit comments

Comments
 (0)