From 29d93d5c675c34c04359fc4d13d179ac92a07d62 Mon Sep 17 00:00:00 2001 From: Marius Messerschmidt Date: Sat, 18 Nov 2023 15:26:07 +0100 Subject: [PATCH] Spelling: fix spelling of files in src/common --- src/common/format.c | 4 ++-- src/common/io/io.h | 6 +++--- src/common/io/io_unix.c | 14 +++++++------- src/common/io/io_windows.c | 10 +++++----- src/common/printing.c | 2 +- src/common/properties.c | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/common/format.c b/src/common/format.c index b5092c6c7..a381c2094 100644 --- a/src/common/format.c +++ b/src/common/format.c @@ -203,7 +203,7 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n } // fastforward to the end of the if without printing the in between - i = ffStrbufNextIndexS(formatstr, i, "{?}") + 2; // 2 is the length of "{?}" - 1 because the loop will increament it again directly after continue + i = ffStrbufNextIndexS(formatstr, i, "{?}") + 2; // 2 is the length of "{?}" - 1 because the loop will increment it again directly after continue continue; } @@ -229,7 +229,7 @@ void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t n } // fastforward to the end of the if without printing the in between - i = ffStrbufNextIndexS(formatstr, i, "{/}") + 2; // 2 is the length of "{/}" - 1 because the loop will increament it again directly after continue + i = ffStrbufNextIndexS(formatstr, i, "{/}") + 2; // 2 is the length of "{/}" - 1 because the loop will increment it again directly after continue continue; } diff --git a/src/common/io/io.h b/src/common/io/io.h index 0ea5cf411..d2519e156 100644 --- a/src/common/io/io.h +++ b/src/common/io/io.h @@ -49,11 +49,11 @@ static inline ssize_t ffReadFDData(FFNativeFD fd, size_t dataSize, void* data) #ifndef _WIN32 return read(fd, data, dataSize); #else - DWORD readed; - if(!ReadFile(fd, data, (DWORD)dataSize, &readed, NULL)) + DWORD bytesRead; + if(!ReadFile(fd, data, (DWORD)dataSize, &bytesRead, NULL)) return -1; - return (ssize_t)readed; + return (ssize_t)bytesRead; #endif } diff --git a/src/common/io/io_unix.c b/src/common/io/io_unix.c index d6222a367..0daf53ebc 100644 --- a/src/common/io/io_unix.c +++ b/src/common/io/io_unix.c @@ -44,7 +44,7 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) bool ffAppendFDBuffer(int fd, FFstrbuf* buffer) { - ssize_t readed = 0; + ssize_t bytesRead = 0; struct stat fileInfo; if(fstat(fd, &fileInfo) != 0) @@ -54,10 +54,10 @@ bool ffAppendFDBuffer(int fd, FFstrbuf* buffer) uint32_t free = ffStrbufGetFree(buffer); while( - (readed = read(fd, buffer->chars + buffer->length, free)) > 0 + (bytesRead = read(fd, buffer->chars + buffer->length, free)) > 0 ) { - buffer->length += (uint32_t) readed; - if((uint32_t) readed == free) + buffer->length += (uint32_t) bytesRead; + if((uint32_t) bytesRead == free) ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte. free = ffStrbufGetFree(buffer); } @@ -153,14 +153,14 @@ const char* ffGetTerminalResponse(const char* request, const char* format, ...) } char buffer[512]; - ssize_t readed = read(STDIN_FILENO, buffer, sizeof(buffer) - 1); + ssize_t bytesRead = read(STDIN_FILENO, buffer, sizeof(buffer) - 1); tcsetattr(STDIN_FILENO, TCSANOW, &oldTerm); - if(readed <= 0) + if(bytesRead <= 0) return "read(STDIN_FILENO, buffer, sizeof(buffer) - 1) failed"; - buffer[readed] = '\0'; + buffer[bytesRead] = '\0'; va_list args; va_start(args, format); diff --git a/src/common/io/io_windows.c b/src/common/io/io_windows.c index 1917bc3ed..d0d5bd135 100644 --- a/src/common/io/io_windows.c +++ b/src/common/io/io_windows.c @@ -32,7 +32,7 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) bool ffAppendFDBuffer(HANDLE handle, FFstrbuf* buffer) { - DWORD readed = 0; + DWORD bytesRead = 0; LARGE_INTEGER fileSize; if(!GetFileSizeEx(handle, &fileSize)) @@ -43,11 +43,11 @@ bool ffAppendFDBuffer(HANDLE handle, FFstrbuf* buffer) bool success; while( - (success = !!ReadFile(handle, buffer->chars + buffer->length, free, &readed, NULL)) && - readed > 0 + (success = !!ReadFile(handle, buffer->chars + buffer->length, free, &bytesRead, NULL)) && + bytesRead > 0 ) { - buffer->length += (uint32_t) readed; - if((uint32_t) readed == free) + buffer->length += (uint32_t) bytesRead; + if((uint32_t) bytesRead == free) ffStrbufEnsureFree(buffer, buffer->allocated - 1); // Doubles capacity every round. -1 for the null byte. free = ffStrbufGetFree(buffer); } diff --git a/src/common/printing.c b/src/common/printing.c index 21df19cb3..90830568c 100644 --- a/src/common/printing.c +++ b/src/common/printing.c @@ -6,7 +6,7 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu { ffLogoPrintLine(); - //This is used by --set-keyless, in this case we wan't neither the module name nor the separator + //This is used by --set-keyless, in this case we want neither the module name nor the separator if(moduleName == NULL) return; diff --git a/src/common/properties.c b/src/common/properties.c index c91f107eb..f5180aa11 100644 --- a/src/common/properties.c +++ b/src/common/properties.c @@ -91,7 +91,7 @@ bool ffParsePropLines(const char* lines, const char* start, FFstrbuf* buffer) // The following functions return true if the file was found, independently if start was found // Buffers which already contain content are not overwritten -// The last occurence of start in the first file will be the one used +// The last occurrence of start in the first file will be the one used bool ffParsePropFileValues(const char* filename, uint32_t numQueries, FFpropquery* queries) {