summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/http_client.h2
-rw-r--r--core/io/http_client_tcp.cpp2
-rw-r--r--core/io/http_client_tcp.h2
-rw-r--r--core/io/image.cpp5
-rw-r--r--core/io/marshalls.cpp5
5 files changed, 7 insertions, 9 deletions
diff --git a/core/io/http_client.h b/core/io/http_client.h
index 8be6e6524c..90c859d685 100644
--- a/core/io/http_client.h
+++ b/core/io/http_client.h
@@ -180,7 +180,7 @@ public:
virtual bool is_response_chunked() const = 0;
virtual int get_response_code() const = 0;
virtual Error get_response_headers(List<String> *r_response) = 0;
- virtual int get_response_body_length() const = 0;
+ virtual int64_t get_response_body_length() const = 0;
virtual PackedByteArray read_response_body_chunk() = 0; // Can't get body as partial text because of most encodings UTF8, gzip, etc.
diff --git a/core/io/http_client_tcp.cpp b/core/io/http_client_tcp.cpp
index 4c27cd1b10..6e4417e1ff 100644
--- a/core/io/http_client_tcp.cpp
+++ b/core/io/http_client_tcp.cpp
@@ -534,7 +534,7 @@ Error HTTPClientTCP::poll() {
return OK;
}
-int HTTPClientTCP::get_response_body_length() const {
+int64_t HTTPClientTCP::get_response_body_length() const {
return body_size;
}
diff --git a/core/io/http_client_tcp.h b/core/io/http_client_tcp.h
index 886ad0ef48..3fe8e2c0df 100644
--- a/core/io/http_client_tcp.h
+++ b/core/io/http_client_tcp.h
@@ -87,7 +87,7 @@ public:
bool is_response_chunked() const override;
int get_response_code() const override;
Error get_response_headers(List<String> *r_response) override;
- int get_response_body_length() const override;
+ int64_t get_response_body_length() const override;
PackedByteArray read_response_body_chunk() override;
void set_blocking_mode(bool p_enable) override;
bool is_blocking_mode_enabled() const override;
diff --git a/core/io/image.cpp b/core/io/image.cpp
index 7956d0bad7..9df2b6835c 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -1434,12 +1434,11 @@ int Image::_get_dst_image_size(int p_width, int p_height, Format p_format, int &
}
// Set mipmap size.
- // It might be necessary to put this after the minimum mipmap size check because of the possible occurrence of "1 >> 1".
if (r_mm_width) {
- *r_mm_width = bw >> 1;
+ *r_mm_width = w;
}
if (r_mm_height) {
- *r_mm_height = bh >> 1;
+ *r_mm_height = h;
}
// Reach target mipmap.
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 6a0668f027..555d4f6df4 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -52,9 +52,8 @@ ObjectID EncodedObjectAsID::get_object_id() const {
return id;
}
-#define _S(a) ((int32_t)a)
-#define ERR_FAIL_ADD_OF(a, b, err) ERR_FAIL_COND_V(_S(b) < 0 || _S(a) < 0 || _S(a) > INT_MAX - _S(b), err)
-#define ERR_FAIL_MUL_OF(a, b, err) ERR_FAIL_COND_V(_S(a) < 0 || _S(b) <= 0 || _S(a) > INT_MAX / _S(b), err)
+#define ERR_FAIL_ADD_OF(a, b, err) ERR_FAIL_COND_V(((int32_t)(b)) < 0 || ((int32_t)(a)) < 0 || ((int32_t)(a)) > INT_MAX - ((int32_t)(b)), err)
+#define ERR_FAIL_MUL_OF(a, b, err) ERR_FAIL_COND_V(((int32_t)(a)) < 0 || ((int32_t)(b)) <= 0 || ((int32_t)(a)) > INT_MAX / ((int32_t)(b)), err)
#define ENCODE_MASK 0xFF
#define ENCODE_FLAG_64 1 << 16