From 2016b4ef7f0b982cbb9298bb86a571bb3ff23b45 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 12 Aug 2020 21:48:19 +1000 Subject: [PATCH] 1 less error when compiling as C++ also fix mistake in readme (thanks kylbert) --- readme.md | 2 +- src/Http.c | 6 +++--- src/Http.h | 2 +- src/Protocol.c | 7 ++----- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 50fd42c33..f13521f72 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,7 @@ It **does not** work with 'modern/premium' Minecraft servers. * macOS: macOS 10.5 or later. (Can be compiled to work with 10.3/10.4 though) * Linux: libcurl and libopenal. -**Note:** When running from within VirtualBox, disable Mouse Integration, otherwise the camera will not work propery. +**Note:** When running from within VirtualBox, disable Mouse Integration, otherwise the camera will not work properly. #### Instructions Initially, you will need to run ClassiCube.exe to download the required assets from minecraft.net. diff --git a/src/Http.c b/src/Http.c index 5cec87390..3466d2a2f 100644 --- a/src/Http.c +++ b/src/Http.c @@ -127,8 +127,8 @@ static void Http_Add(const String* url, cc_bool priority, const String* id, cc_u Mem_Copy(req.data, data, size); req.size = size; } - req.cookies = cookies; - req.timeAdded = DateTime_CurrentUTC_MS(); + req.cookies = cookies; + req._timeAdded = Stopwatch_Measure(); Mutex_Lock(pendingMutex); { @@ -193,7 +193,7 @@ static void Http_CompleteRequest(struct HttpRequest* req) { if (index >= 0) { /* very rare case - priority item was inserted, then inserted again (so put before first item), */ /* and both items got downloaded before an external function removed them from the queue */ - if (older.timeAdded > req->timeAdded) { + if (older._timeAdded > req->_timeAdded) { HttpRequest_Free(req); } else { /* normal case, replace older req */ diff --git a/src/Http.h b/src/Http.h index 012507088..d19b1ae41 100644 --- a/src/Http.h +++ b/src/Http.h @@ -22,7 +22,7 @@ enum HttpProgress { struct HttpRequest { char url[URL_MAX_SIZE]; /* URL data is downloaded from/uploaded to. */ char id[URL_MAX_SIZE]; /* Unique identifier for this request. */ - TimeMS timeAdded; /* Time this request was added to queue of requests. */ + cc_uint64 _timeAdded; /* Timestamp this request was added to requests queue. */ TimeMS timeDownloaded; /* Time response contents were completely downloaded. */ int statusCode; /* HTTP status code returned in the response. */ cc_uint32 contentLength; /* HTTP content length returned in the response. */ diff --git a/src/Protocol.c b/src/Protocol.c index 869ccb2b1..b6d626ed0 100644 --- a/src/Protocol.c +++ b/src/Protocol.c @@ -1458,11 +1458,8 @@ static void CPE_DefineModel(cc_uint8* data) { } cm->numParts = numParts; - cm->model.vertices = Mem_AllocCleared( - numParts * MODEL_BOX_VERTICES, - sizeof(struct ModelVertex), - "CustomModel vertices" - ); + cm->model.vertices = (struct ModelVertex*)Mem_AllocCleared(numParts * MODEL_BOX_VERTICES, + sizeof(struct ModelVertex), "CustomModel vertices"); cm->defined = true; }