From e700c764e8d69ac877ae010533db907066f86e09 Mon Sep 17 00:00:00 2001 From: randomdude999 Date: Mon, 22 Jan 2024 23:21:54 +0200 Subject: [PATCH] use int64_t instead of ssize_t --- src/asar/arch-65816.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/asar/arch-65816.cpp b/src/asar/arch-65816.cpp index 4fbbea8b..f42c9b98 100644 --- a/src/asar/arch-65816.cpp +++ b/src/asar/arch-65816.cpp @@ -1,4 +1,3 @@ -#include #include "asar.h" #include "assembleblock.h" #include "asar_math.h" @@ -39,7 +38,7 @@ struct insn_context { // checks for matching characters at the start of haystack, ignoring spaces. // returns index into haystack right after the match template -ssize_t startmatch(const string& haystack) { +int64_t startmatch(const string& haystack) { static const char needle[] = {chars...}; size_t haystack_i = 0; for(size_t i = 0; i < sizeof...(chars); i++) { @@ -52,10 +51,10 @@ ssize_t startmatch(const string& haystack) { // checks for matching characters at the end of haystack, ignoring spaces. // returns index into haystack right before the match template -ssize_t endmatch(const string& haystack) { +int64_t endmatch(const string& haystack) { static const char needle[] = {chars...}; - ssize_t haystack_i = haystack.length()-1; - for(ssize_t i = sizeof...(chars)-1; i >= 0; i--) { + int64_t haystack_i = haystack.length()-1; + for(int64_t i = sizeof...(chars)-1; i >= 0; i--) { while(haystack_i >= 0 && haystack[haystack_i] == ' ') haystack_i--; if(haystack_i < 0 || needle[i] != to_lower(haystack[haystack_i--])) return -1; } @@ -69,7 +68,7 @@ ssize_t endmatch(const string& haystack) { // i still don't like this function... template std::pair parse_addr_kind(insn_context& arg) { - ssize_t start_i = 0, end_i = arg.arg.length(); + int64_t start_i = 0, end_i = arg.arg.length(); // If this addressing kind is allowed, return it, along with a trimmed version of the string. #define RETURN_IF_ALLOWED(kind) \ if constexpr(((allowed_kinds == addr_kind::kind) || ...)) { \