From 399eed8bd84c79e51960247bf75415088b9f3de1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 27 Dec 2022 08:30:18 +0800 Subject: [PATCH] 1 --- a8/collision.cc | 4 +++- a8/strutils.cc | 5 +++++ a8/types.h | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/a8/collision.cc b/a8/collision.cc index b0b80de..cab0a23 100644 --- a/a8/collision.cc +++ b/a8/collision.cc @@ -173,6 +173,7 @@ namespace a8 } b_edges.push_back(seg); } + #if 0 auto GetProjectionWithAxis = [] (std::vector vertices, a8::Vec2 axis) -> a8::Vec2 { axis.Normalize(); @@ -182,6 +183,7 @@ namespace a8 } }; + #endif return false; } @@ -207,7 +209,7 @@ namespace a8 if (distance > _max) { return false; } - float angle = (a_pos - b_pos).CalcAngleEx(a8::Vec2::UP); + //float angle = (a_pos - b_pos).CalcAngleEx(a8::Vec2::UP); return false; } diff --git a/a8/strutils.cc b/a8/strutils.cc index 60b1b57..18652fb 100644 --- a/a8/strutils.cc +++ b/a8/strutils.cc @@ -399,6 +399,10 @@ namespace a8 return strcmp(s1 ? s1 : "", s2 ? s2 : ""); } + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-variable" + #pragma GCC diagnostic ignored "-Wunused-but-set-variable" + size_t GetUtf8Length(const char *str) { static unsigned char utf8_look_for_table[] = @@ -455,6 +459,7 @@ namespace a8 len++, ptr+=UTFLEN((unsigned char)*ptr)) ; return len; } + #pragma GCC diagnostic pop std::string CopyString(const std::string& str) { diff --git a/a8/types.h b/a8/types.h index 21d1ca9..80e33aa 100644 --- a/a8/types.h +++ b/a8/types.h @@ -22,10 +22,10 @@ namespace a8 struct SendQueueNode { - char* buff = nullptr; - unsigned int bufflen = 0; - unsigned int sent_bytes = 0; - SendQueueNode* next = nullptr; + char* buff; + unsigned int bufflen; + unsigned int sent_bytes; + SendQueueNode* next; }; typedef std::function CommonCbProc;