Skip to content

Commit a39b2e8

Browse files
committed
Fix some ci warnings
1 parent b4667ac commit a39b2e8

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

tests/cpp-tests/Source/DrawNodeExTest/DrawNodeExTest.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DrawNodePictureTest : public DrawNodeExBaseTest
4747

4848
virtual std::string title() const override;
4949
virtual std::string subtitle() const override;
50-
void update(float dt);
50+
void update(float dt) override;
5151

5252
private:
5353
ax::extension::DrawNodeEx* drawNodeEx;
@@ -63,7 +63,7 @@ class DrawNodeMorphTest : public DrawNodeExBaseTest
6363

6464
virtual std::string title() const override;
6565
virtual std::string subtitle() const override;
66-
void update(float dt);
66+
void update(float dt) override;
6767

6868
private:
6969
ax::extension::DrawNodeEx* drawNodeEx;
@@ -96,7 +96,7 @@ class DrawNodeFireworkTest : public DrawNodeExBaseTest
9696

9797
virtual std::string title() const override;
9898
virtual std::string subtitle() const override;
99-
void update(float dt);
99+
void update(float dt) override;
100100

101101
fireObj* createFireObjs(int count);
102102

@@ -174,7 +174,7 @@ class DrawNodeThicknessTest : public DrawNodeExBaseTest
174174

175175
virtual std::string title() const override;
176176
virtual std::string subtitle() const override;
177-
void update(float dt);
177+
void update(float dt) override;
178178

179179
void initSliders();
180180
void changeThickness(ax::Object* pSender, ax::ui::Slider::EventType type);
@@ -198,7 +198,7 @@ class DrawNodeVersionsTest : public DrawNodeExBaseTest
198198

199199
virtual std::string title() const override;
200200
virtual std::string subtitle() const override;
201-
void update(float dt);
201+
void update(float dt) override;
202202

203203
private:
204204
ax::extension::DrawNodeEx* drawNodeEx;
@@ -225,7 +225,7 @@ class DrawNodePieTest : public DrawNodeExBaseTest
225225

226226
virtual std::string title() const override;
227227
virtual std::string subtitle() const override;
228-
void update(float dt);
228+
void update(float dt) override;
229229

230230
void initSliders();
231231
void changeStartAngle(ax::Object* pSender, ax::ui::Slider::EventType type);
@@ -254,7 +254,7 @@ class DrawNodeMethodesTest : public DrawNodeExBaseTest
254254

255255
virtual std::string title() const override;
256256
virtual std::string subtitle() const override;
257-
void update(float dt);
257+
void update(float dt) override;
258258

259259
void sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type);
260260
void listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type);
@@ -288,7 +288,7 @@ class DrawNodePerformaneTest : public DrawNodeExBaseTest
288288

289289
virtual std::string title() const override;
290290
virtual std::string subtitle() const override;
291-
void update(float dt);
291+
void update(float dt) override;
292292

293293
void sliderCallback(ax::Object* sender, ax::ui::Slider::EventType type);
294294
void listviewCallback(ax::Object* sender, ax::ui::ListView::EventType type);
@@ -319,7 +319,7 @@ class DrawNodeHeartTest : public DrawNodeExBaseTest
319319

320320
virtual std::string title() const override;
321321
virtual std::string subtitle() const override;
322-
void update(float dt);
322+
void update(float dt) override;
323323

324324
private:
325325
ax::extension::DrawNodeEx* drawNodeEx;
@@ -338,7 +338,7 @@ class DrawNodeDrawInWrongOrder_Issue1888 : public DrawNodeExBaseTest
338338

339339
virtual std::string title() const override;
340340
virtual std::string subtitle() const override;
341-
void update(float dt);
341+
void update(float dt) override;
342342

343343
private:
344344
ax::extension::DrawNodeEx* drawNodeEx;
@@ -380,7 +380,7 @@ class DrawNodeCocos2dxBetterCircleRendering : public DrawNodeExBaseTest
380380

381381
virtual std::string title() const override;
382382
virtual std::string subtitle() const override;
383-
void update(float dt);
383+
void update(float dt) override;
384384

385385
void initSliders();
386386
void changeThreshold(Object* pSender, ax::ui::Slider::EventType type);
@@ -426,7 +426,7 @@ class DrawNodeCocos2dxDrawNodePieTest : public DrawNodeExBaseTest
426426

427427
virtual std::string title() const override;
428428
virtual std::string subtitle() const override;
429-
void update(float dt);
429+
void update(float dt) override;
430430

431431
void initSliders();
432432
void changeStartAngle(Object* pSender, ax::ui::Slider::EventType type);

tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ void AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh(Object* sender)
10371037
int32_t index = 0;
10381038
for (const auto& path : _paths)
10391039
{
1040-
MeshRenderer::createAsync(path, AX_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), (void*)index++);
1040+
MeshRenderer::createAsync(path, AX_CALLBACK_2(AsyncLoadMeshRendererTest::asyncLoad_Callback, this), reinterpret_cast<void*>(static_cast<uintptr_t>(++index)));
10411041
}
10421042
}
10431043

tests/cpp-tests/Source/NetworkTest/WebSocketTest/WebSocketTest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void WebSocketTest::startTestCallback(Object* sender)
189189
void WebSocketTest::onOpen(network::WebSocket* ws)
190190
{
191191
char status[256] = {0};
192-
sprintf(status, "Opened, url: %s, protocol: %s", ws->getUrl().data(), ws->getProtocol().data());
192+
fmt::format_to(status, "Opened, url: {}, protocol: {}", ws->getUrl(), ws->getProtocol());
193193

194194
AXLOGI("Websocket ({}) was opened, url: {}, protocol: {}", fmt::ptr(ws), ws->getUrl(), ws->getProtocol());
195195
if (ws == _wsiSendText)
@@ -221,7 +221,7 @@ void WebSocketTest::onMessage(network::WebSocket* ws, const network::WebSocket::
221221
{
222222
_sendBinaryTimes++;
223223
char times[100] = {0};
224-
sprintf(times, "%d", _sendBinaryTimes);
224+
fmt::format_to(times, "{}", _sendBinaryTimes);
225225

226226
std::string binaryStr = "response bin msg: ";
227227

@@ -271,7 +271,7 @@ void WebSocketTest::onError(network::WebSocket* ws, const network::WebSocket::Er
271271
{
272272
AXLOGD("Error was fired, error code: {}", static_cast<int>(error));
273273
char buf[100] = {0};
274-
sprintf(buf, "An error was fired, code: %s", static_cast<int>(error));
274+
fmt::format_to(buf, "An error was fired, code: {}", static_cast<int>(error));
275275

276276
if (ws == _wsiSendText)
277277
{
@@ -521,7 +521,7 @@ void WebSocketDelayTest::doReceiveText()
521521
void WebSocketDelayTest::onOpen(network::WebSocket* ws)
522522
{
523523
char status[256] = {0};
524-
sprintf(status, "Opened, url: %s, protocol: %s", ws->getUrl(), ws->getProtocol());
524+
fmt::format_to(status, "Opened, url: {}, protocol: {}", ws->getUrl(), ws->getProtocol());
525525

526526
AXLOGD("Websocket ({}) was opened, url: {}, protocol: {}", fmt::ptr(ws), ws->getUrl(), ws->getProtocol());
527527
if (ws == _wsiSendText)
@@ -536,7 +536,7 @@ void WebSocketDelayTest::onMessage(network::WebSocket* ws, const network::WebSoc
536536
{
537537
_receiveTextTimes++;
538538
char times[100] = {0};
539-
sprintf(times, "%d", _receiveTextTimes);
539+
fmt::format_to(times, "{}", _receiveTextTimes);
540540
std::string textStr = std::string("response text msg: ") + data.bytes + ", " + times;
541541
AXLOGD("{}", textStr);
542542
doReceiveText();
@@ -563,7 +563,7 @@ void WebSocketDelayTest::onError(network::WebSocket* ws, const network::WebSocke
563563
{
564564
AXLOGD("Error was fired, error code: {}", static_cast<int>(error));
565565
char buf[100] = {0};
566-
sprintf(buf, "An error was fired, code: %d", static_cast<int>(error));
566+
fmt::format_to(buf, "An error was fired, code: {}", static_cast<int>(error));
567567

568568
if (ws == _wsiSendText)
569569
{

0 commit comments

Comments
 (0)