mirror of
https://github.com/openharmony/tools_previewer.git
synced 2026-07-21 01:35:22 -04:00
add util part 4,util/linux,util/unix and modify warns
Signed-off-by: libenyao <libenyao@h-partners.com>
This commit is contained in:
@@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <thread>
|
||||
#include "CommandLineInterface.h"
|
||||
#include "PreviewerEngineLog.h"
|
||||
#include "WebSocketServer.h"
|
||||
#include <thread>
|
||||
using namespace std;
|
||||
|
||||
lws* WebSocketServer::webSocket = nullptr;
|
||||
@@ -96,7 +96,9 @@ void WebSocketServer::sigint_handler(int sig)
|
||||
|
||||
void WebSocketServer::StartWebsocketListening()
|
||||
{
|
||||
signal(SIGINT, sigint_handler);
|
||||
if (signal(SIGINT, sigint_handler) == SIG_ERR) {
|
||||
return;
|
||||
}
|
||||
ILOG("Begin to start websocket listening!");
|
||||
struct lws_context_creation_info contextInfo = {0};
|
||||
contextInfo.port = serverPort;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#define WEBSOCKETSERVER_H
|
||||
|
||||
#include <thread>
|
||||
#include <signal.h>
|
||||
#include <csignal>
|
||||
#include <mutex>
|
||||
#include "libwebsockets.h"
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
void StartWebsocketListening();
|
||||
void Run();
|
||||
size_t WriteData(unsigned char* data, size_t length);
|
||||
enum WebSocketState { INIT = -1, UNWRITEABLE = 0, WRITEABLE = 1 };
|
||||
enum class WebSocketState { INIT = -1, UNWRITEABLE = 0, WRITEABLE = 1 };
|
||||
static WebSocketState webSocketWritable;
|
||||
static uint8_t* firstImageBuffer;
|
||||
static uint64_t firstImagebufferSize;
|
||||
|
||||
@@ -39,7 +39,7 @@ const string ClipboardX11::GetClipboardData()
|
||||
int ret = DefaultScreen(display);
|
||||
window = XCreateSimpleWindow(display, RootWindow(display, ret), 0, 0, 1, 1, 0,
|
||||
BlackPixel(display, ret), WhitePixel(display, ret));
|
||||
string retStr;
|
||||
string retStr; // NOLINT
|
||||
UTF8 = XInternAtom(display, "UTF8_STRING", True);
|
||||
if (UTF8 != None) retStr = GetPasteType(UTF8);
|
||||
if (retStr.empty()) retStr = GetPasteType(XA_STRING);
|
||||
|
||||
@@ -28,7 +28,9 @@ using namespace std;
|
||||
|
||||
void CrashHandler::InitExceptionHandler()
|
||||
{
|
||||
signal(SIGSEGV, ApplicationCrashHandler);
|
||||
if (signal(SIGSEGV, ApplicationCrashHandler) == SIG_ERR) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CrashHandler::ApplicationCrashHandler(int signal)
|
||||
|
||||
Reference in New Issue
Block a user