diff --git a/src/asm/rpn.cpp b/src/asm/rpn.cpp index 7100556f..c232422b 100644 --- a/src/asm/rpn.cpp +++ b/src/asm/rpn.cpp @@ -557,7 +557,7 @@ void rpn_BinaryOp(enum RPNCommand op, struct Expression *expr, len = sizeof(bytes); patchSize = sizeof(bytes); } else { - ptr = &(*src2->rpn)[0]; // Pointer to the right RPN + ptr = src2->rpn->data(); // Pointer to the right RPN len = src2->rpn->size(); // Size of the right RPN patchSize = src2->rpnPatchSize; } diff --git a/src/link/object.cpp b/src/link/object.cpp index 78d093d6..2a81c349 100644 --- a/src/link/object.cpp +++ b/src/link/object.cpp @@ -233,7 +233,7 @@ static void readPatch(FILE *file, struct Patch *patch, char const *fileName, std fileName, sectName.c_str(), i); patch->rpnExpression.resize(rpnSize); - size_t nbElementsRead = fread(&patch->rpnExpression[0], 1, rpnSize, file); + size_t nbElementsRead = fread(patch->rpnExpression.data(), 1, rpnSize, file); if (nbElementsRead != rpnSize) errx("%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s RPN expression: %s", @@ -306,7 +306,7 @@ static void readSection(FILE *file, struct Section *section, char const *fileNam if (sect_HasData(section->type)) { if (section->size) { section->data.resize(section->size); - if (size_t nbRead = fread(§ion->data[0], 1, section->size, file); + if (size_t nbRead = fread(section->data.data(), 1, section->size, file); nbRead != section->size) errx("%s: Cannot read \"%s\"'s data: %s", fileName, section->name.c_str(), feof(file) ? "Unexpected end of file" : strerror(errno)); diff --git a/src/link/output.cpp b/src/link/output.cpp index fdcc66be..675e6e45 100644 --- a/src/link/output.cpp +++ b/src/link/output.cpp @@ -174,7 +174,7 @@ static void writeBank(std::deque *bankSections, uint16_t } // Output the section itself - fwrite(§ion->data[0], 1, section->size, outputFile); + fwrite(section->data.data(), 1, section->size, outputFile); if (overlayFile) { // Skip bytes even with pipes for (uint16_t i = 0; i < section->size; i++) diff --git a/src/link/patch.cpp b/src/link/patch.cpp index 5cd6e819..e5aaca60 100644 --- a/src/link/patch.cpp +++ b/src/link/patch.cpp @@ -82,7 +82,7 @@ static int32_t computeRPNExpr(struct Patch const *patch, // Small shortcut to avoid a lot of repetition #define popRPN() popRPN(patch->src, patch->lineNo) - uint8_t const *expression = &patch->rpnExpression[0]; + uint8_t const *expression = patch->rpnExpression.data(); int32_t size = (int32_t)patch->rpnExpression.size(); rpnStack.clear();