Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile macOS Intel Version on Apple Silicon #656

Merged
merged 16 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -24,12 +24,12 @@ jobs:
cc: cl
cxx: cl
name: Windows-x64
- runner: macos-13 # Should be Intel
- runner: macos-14 # Apple Silicon, but we cross-compile
preset: mac
cc: cc
cxx: c++
name: macOS-Intel
- runner: macos-14 # This is supposed to be M1
- runner: macos-14 # Apple Silicon
preset: mac
cc: cc
cxx: c++
@@ -60,11 +60,21 @@ jobs:
with:
submodules: recursive

- name: Install macOS Rosetta 2
if: ${{ matrix.os.name == 'macOS-Intel' }}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license

- name: Install Intel version of Brew
if: ${{ matrix.os.name == 'macOS-Intel' }}
shell: arch -x86_64 /bin/bash -e {0}
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/usr/local/bin/brew shellenv)" # makes the Intel version of Brew and its installs are enshrined as the default
echo "PATH=$PATH" >> $GITHUB_ENV # modify $PATH so the above step persists into the future steps

- name: Install macOS dependencies
if: ${{ matrix.os.preset == 'mac' }}
run: |
# Install packages from Homebrew
brew bundle install
run: brew bundle install

- name: Install Linux dependencies
if: ${{ matrix.os.runner == 'ubuntu-latest' }}

Unchanged files with check annotations Beta

0.0012475221f, -0.0024950907f, -0.0087309526f, 0.019957958f, 0.050528999f, -0.12055097f, -0.29304558f, 0.70617616f,
};
const float T911 = -32767.0f;

Check warning on line 146 in AudioEncode/aencode.cpp

GitHub Actions / macOS-ARM, Debug

unused variable 'T911' [-Wunused-const-variable]

Check warning on line 146 in AudioEncode/aencode.cpp

GitHub Actions / macOS-ARM, Release

unused variable 'T911' [-Wunused-const-variable]

Check warning on line 146 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64-clang, Debug

unused variable 'T911' [-Wunused-const-variable]

Check warning on line 146 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64-clang, Release

unused variable 'T911' [-Wunused-const-variable]

Check warning on line 146 in AudioEncode/aencode.cpp

GitHub Actions / macOS-Intel, Debug

unused variable 'T911' [-Wunused-const-variable]

Check warning on line 146 in AudioEncode/aencode.cpp

GitHub Actions / macOS-Intel, Release

unused variable 'T911' [-Wunused-const-variable]
const float T913 = 32767.0f;

Check warning on line 147 in AudioEncode/aencode.cpp

GitHub Actions / macOS-ARM, Debug

unused variable 'T913' [-Wunused-const-variable]

Check warning on line 147 in AudioEncode/aencode.cpp

GitHub Actions / macOS-ARM, Release

unused variable 'T913' [-Wunused-const-variable]

Check warning on line 147 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64-clang, Debug

unused variable 'T913' [-Wunused-const-variable]

Check warning on line 147 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64-clang, Release

unused variable 'T913' [-Wunused-const-variable]

Check warning on line 147 in AudioEncode/aencode.cpp

GitHub Actions / macOS-Intel, Debug

unused variable 'T913' [-Wunused-const-variable]

Check warning on line 147 in AudioEncode/aencode.cpp

GitHub Actions / macOS-Intel, Release

unused variable 'T913' [-Wunused-const-variable]
const float T1266 = 0.0f;

Check warning on line 148 in AudioEncode/aencode.cpp

GitHub Actions / macOS-ARM, Debug

unused variable 'T1266' [-Wunused-const-variable]

Check warning on line 148 in AudioEncode/aencode.cpp

GitHub Actions / macOS-ARM, Release

unused variable 'T1266' [-Wunused-const-variable]

Check warning on line 148 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64-clang, Debug

unused variable 'T1266' [-Wunused-const-variable]

Check warning on line 148 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64-clang, Release

unused variable 'T1266' [-Wunused-const-variable]

Check warning on line 148 in AudioEncode/aencode.cpp

GitHub Actions / macOS-Intel, Debug

unused variable 'T1266' [-Wunused-const-variable]

Check warning on line 148 in AudioEncode/aencode.cpp

GitHub Actions / macOS-Intel, Release

unused variable 'T1266' [-Wunused-const-variable]
void WriteBand_Fmt0(Encoder &enc, int32_t colIndex, uint32_t formatId) {}
int32_t sample = 0;
if (enc.m_finishedReading == 0) {
sample = (*enc.m_reader)(enc.m_pReaderData);
if (sample == ReadSampleEof) {

Check warning on line 959 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64, Debug

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]

Check warning on line 959 in AudioEncode/aencode.cpp

GitHub Actions / Linux-x64, Release

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]

Check warning on line 959 in AudioEncode/aencode.cpp

GitHub Actions / Linux-cross-arm64, Release

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]

Check warning on line 959 in AudioEncode/aencode.cpp

GitHub Actions / Linux-cross-arm64, Debug

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]
enc.m_finishedReading = 1;
return;
}
#ifdef __STDC_LIB_EXT1__
len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
#else
len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);

Check warning on line 776 in third_party/stb/stb_image_write.h

GitHub Actions / macOS-ARM, Debug

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Check warning on line 776 in third_party/stb/stb_image_write.h

GitHub Actions / macOS-ARM, Release

'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
#endif
s->func(s->context, buffer, len);
}
// Get rid of the "no return value" warnings in the next three functions
#pragma warning(disable : 4035)

Check warning on line 129 in fix/fix.cpp

GitHub Actions / macOS-ARM, Debug

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 129 in fix/fix.cpp

GitHub Actions / macOS-ARM, Release

unknown pragma ignored [-Wunknown-pragmas]
// compute inverse sine
angle FixAsin(float v) {
const vector Zero_vector = {0.0f, 0.0f, 0.0f};
// Disable the "possible loss of data" warning
#pragma warning(disable : 4244)

Check warning on line 28 in scripts/osiris_vector.h

GitHub Actions / macOS-ARM, Debug

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 28 in scripts/osiris_vector.h

GitHub Actions / macOS-ARM, Debug

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 28 in scripts/osiris_vector.h

GitHub Actions / macOS-ARM, Release

unknown pragma ignored [-Wunknown-pragmas]
// Used for debugging. It is used in printf's so we do not have to write out the structure 3 times
// to print all the coordinates.
// #define MEM_DEBUG
#ifdef MEM_USE_RTL
#pragma message("mem.cpp: Compiling For Run-Time Library usage")

Check warning on line 218 in mem/mem.cpp

GitHub Actions / macOS-ARM, Debug

mem.cpp: Compiling For Run-Time Library usage [-W#pragma-messages]

Check warning on line 218 in mem/mem.cpp

GitHub Actions / macOS-ARM, Release

mem.cpp: Compiling For Run-Time Library usage [-W#pragma-messages]

Check warning on line 218 in mem/mem.cpp

GitHub Actions / macOS-Intel, Debug

mem.cpp: Compiling For Run-Time Library usage [-W#pragma-messages]

Check warning on line 218 in mem/mem.cpp

GitHub Actions / macOS-Intel, Release

mem.cpp: Compiling For Run-Time Library usage [-W#pragma-messages]
#endif
#ifdef MEM_DEBUG
char file[17];
};
static void *Mem_failsafe_block = nullptr;

Check warning on line 244 in mem/mem.cpp

GitHub Actions / macOS-ARM, Debug

unused variable 'Mem_failsafe_block' [-Wunused-variable]

Check warning on line 244 in mem/mem.cpp

GitHub Actions / macOS-ARM, Release

unused variable 'Mem_failsafe_block' [-Wunused-variable]

Check warning on line 244 in mem/mem.cpp

GitHub Actions / macOS-Intel, Debug

unused variable 'Mem_failsafe_block' [-Wunused-variable]

Check warning on line 244 in mem/mem.cpp

GitHub Actions / macOS-Intel, Release

unused variable 'Mem_failsafe_block' [-Wunused-variable]
bool Mem_low_memory_mode = false;
bool Mem_superlow_memory_mode = false;
return 0;
}
#endif
int len = strlen(src) + 1;

Check warning on line 633 in mem/mem.cpp

GitHub Actions / Windows-x64, Debug

'initializing': conversion from 'size_t' to 'int', possible loss of data

Check warning on line 633 in mem/mem.cpp

GitHub Actions / Windows-x64, Release

'initializing': conversion from 'size_t' to 'int', possible loss of data
// strdup_malloc_line = __LINE__+1;
// Leave this line here!
char *dest = (char *)mem_malloc_sub(len, file, line);
int mem_size_sub(void *memblock) {
#ifdef MEM_USE_RTL
return _msize(memblock);

Check warning on line 680 in mem/mem.cpp

GitHub Actions / Windows-x64, Debug

'return': conversion from 'size_t' to 'int', possible loss of data

Check warning on line 680 in mem/mem.cpp

GitHub Actions / Windows-x64, Release

'return': conversion from 'size_t' to 'int', possible loss of data
#else // MEM_USE_RTL
#if defined(WIN32)
if (!Heap) {
/***********************************
* hash function applied to data *
***********************************/
uint32_t hval = (uint32_t)data->ptr;

Check warning on line 883 in mem/mem.cpp

GitHub Actions / Windows-x64, Debug

'type cast': pointer truncation from 'void *' to 'uint32_t'

Check warning on line 883 in mem/mem.cpp

GitHub Actions / Windows-x64, Debug

'type cast': truncation from 'void *' to 'uint32_t'

Check warning on line 883 in mem/mem.cpp

GitHub Actions / Windows-x64, Release

'type cast': pointer truncation from 'void *' to 'uint32_t'

Check warning on line 883 in mem/mem.cpp

GitHub Actions / Windows-x64, Release

'type cast': truncation from 'void *' to 'uint32_t'
return (hval % MEM_MAX_MALLOCS);
}
Node *insertNode(T data) {
// -------------------------------------------------------------------
// ddio_ff_SetCoopLevel
// -------------------------------------------------------------------
int ddio_ff_SetCoopLevel(tDevice, int) { return 0; }

Check warning on line 135 in ddio/lnxforcefeedback.cpp

GitHub Actions / macOS-ARM, Debug

unused function 'ddio_ff_SetCoopLevel' [-Wunused-function]

Check warning on line 135 in ddio/lnxforcefeedback.cpp

GitHub Actions / macOS-ARM, Release

unused function 'ddio_ff_SetCoopLevel' [-Wunused-function]

Check warning on line 135 in ddio/lnxforcefeedback.cpp

GitHub Actions / macOS-Intel, Debug

unused function 'ddio_ff_SetCoopLevel' [-Wunused-function]

Check warning on line 135 in ddio/lnxforcefeedback.cpp

GitHub Actions / macOS-Intel, Release

unused function 'ddio_ff_SetCoopLevel' [-Wunused-function]
// -------------------------------------------------------------------
// ddio_ffjoy_Query
// This function will handle all mouse events.
void ddio_InternalMouseFrame(void) {
static unsigned frame_count = 0;

Check warning on line 425 in ddio/lnxmouse.cpp

GitHub Actions / macOS-ARM, Release

variable 'frame_count' set but not used [-Wunused-but-set-variable]

Check warning on line 425 in ddio/lnxmouse.cpp

GitHub Actions / macOS-Intel, Debug

variable 'frame_count' set but not used [-Wunused-but-set-variable]

Check warning on line 425 in ddio/lnxmouse.cpp

GitHub Actions / macOS-Intel, Release

variable 'frame_count' set but not used [-Wunused-but-set-variable]
SDL_PumpEvents();
frame_count++;
}
// Now, make sure there are no other bitmaps with this name
strcat(namedest, ".ogf");
if ((i = bm_FindBitmapName(namedest)) == -1)

Check warning on line 644 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Debug

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 644 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Release

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 644 in bitmap/bitmain.cpp

GitHub Actions / Linux-cross-arm64, Release

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 644 in bitmap/bitmain.cpp

GitHub Actions / Linux-cross-arm64, Debug

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
return -1;
return i;
}
strcpy(namedest, filename);
// Now, make sure there are no other bitmaps with this name
strcat(namedest, ".ogf");
if ((i = bm_FindBitmapName(namedest)) != -1) {

Check warning on line 666 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Debug

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 666 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Release

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 666 in bitmap/bitmain.cpp

GitHub Actions / Linux-cross-arm64, Release

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 666 in bitmap/bitmain.cpp

GitHub Actions / Linux-cross-arm64, Debug

comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
curnum++;
// This name is already taken. Try same name with different number
// appended
// Given two bitmaps, scales the data from src to the size of dest
// Not a particularly fast implementation
void bm_ScaleBitmapToBitmap(int dest, int src) {
uint16_t *dp = bm_data(dest, 0);

Check warning on line 1285 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Release

unused variable ‘dp’ [-Wunused-variable]

Check warning on line 1285 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64-clang, Release

unused variable 'dp' [-Wunused-variable]
uint16_t *sp = bm_data(src, 0);

Check warning on line 1286 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Release

unused variable ‘sp’ [-Wunused-variable]

Check warning on line 1286 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64-clang, Release

unused variable 'sp' [-Wunused-variable]
ASSERT(GameBitmaps[dest].used && dp);
ASSERT(GameBitmaps[src].used && sp);
int smipped = bm_mipped(src);
int dmipped = bm_mipped(dest);

Check warning on line 1290 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Release

unused variable ‘dmipped’ [-Wunused-variable]

Check warning on line 1290 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64-clang, Release

unused variable 'dmipped' [-Wunused-variable]
int limit;
ASSERT(smipped == dmipped);
ASSERT(GameBitmaps[dest].format == GameBitmaps[src].format);
if (windex < how_many_across - 1)
maxx = iopt;
else
maxx = bw - (windex << shift);

Check warning on line 1482 in bitmap/bitmain.cpp

GitHub Actions / Linux-x64, Release

‘shift’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (hindex < how_many_down - 1)
maxy = iopt;
else
return (IFF_SIG_UNKNOWN);
}
int bm_iff_parse_bmhd(CFILE *ifile, uint32_t len, iff_bitmap_header *bmheader) {
len = len;

Check warning on line 177 in bitmap/iff.cpp

GitHub Actions / Linux-x64-clang, Debug

explicitly assigning value of variable of type 'uint32_t' (aka 'unsigned int') to itself [-Wself-assign]

Check warning on line 177 in bitmap/iff.cpp

GitHub Actions / Linux-x64-clang, Release

explicitly assigning value of variable of type 'uint32_t' (aka 'unsigned int') to itself [-Wself-assign]
bmheader->w = cf_ReadShort(ifile, false);
bmheader->h = cf_ReadShort(ifile, false);
}
if (cnt == -1) {
if (!bmheader->w & 1)

Check warning on line 349 in bitmap/iff.cpp

GitHub Actions / Linux-x64-clang, Debug

logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]

Check warning on line 349 in bitmap/iff.cpp

GitHub Actions / Linux-x64-clang, Release

logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
return IFF_CORRUPT;
} else if (cnt)
return IFF_CORRUPT;
CFILE *ifile;
iff_bitmap_header bm_headers[40];
iff_bitmap_header *temp_bm_head;
int32_t sig, form_len;

Check warning on line 552 in bitmap/iff.cpp

GitHub Actions / Linux-x64, Debug

variable ‘form_len’ set but not used [-Wunused-but-set-variable]

Check warning on line 552 in bitmap/iff.cpp

GitHub Actions / Linux-x64, Release

variable ‘form_len’ set but not used [-Wunused-but-set-variable]

Check warning on line 552 in bitmap/iff.cpp

GitHub Actions / Linux-x64-clang, Debug

variable 'form_len' set but not used [-Wunused-but-set-variable]

Check warning on line 552 in bitmap/iff.cpp

GitHub Actions / Linux-x64-clang, Release

variable 'form_len' set but not used [-Wunused-but-set-variable]

Check warning on line 552 in bitmap/iff.cpp

GitHub Actions / Linux-cross-arm64, Release

variable ‘form_len’ set but not used [-Wunused-but-set-variable]

Check warning on line 552 in bitmap/iff.cpp

GitHub Actions / Linux-cross-arm64, Debug

variable ‘form_len’ set but not used [-Wunused-but-set-variable]
int32_t form_type;
int num_bitmaps = 0;
int ret, i;
return Tga_file_data[Fake_pos++];
}
inline int tga_read_int() {

Check warning on line 167 in bitmap/tga.cpp

GitHub Actions / Linux-x64-clang, Debug

unused function 'tga_read_int' [-Wunused-function]
int i;
// Check for bad file
uint8_t upside_down = 0;
uint16_t width, height;
uint32_t pixel;
int i, t, n, data8bit = 0, savepos = 0;

Check warning on line 329 in bitmap/tga.cpp

GitHub Actions / Linux-x64, Debug

variable ‘data8bit’ set but not used [-Wunused-but-set-variable]

Check warning on line 329 in bitmap/tga.cpp

GitHub Actions / Linux-x64, Release

variable ‘data8bit’ set but not used [-Wunused-but-set-variable]

Check warning on line 329 in bitmap/tga.cpp

GitHub Actions / Linux-x64-clang, Debug

variable 'data8bit' set but not used [-Wunused-but-set-variable]

Check warning on line 329 in bitmap/tga.cpp

GitHub Actions / Linux-cross-arm64, Debug

variable ‘data8bit’ set but not used [-Wunused-but-set-variable]
int mipped = 0;
int num_mips = 1;
int read_ok = 1;
uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor;
uint8_t upside_down = 0;
uint16_t width, height;
int i, data8bit = 0, savepos = 0;

Check warning on line 541 in bitmap/tga.cpp

GitHub Actions / Linux-x64, Debug

variable ‘data8bit’ set but not used [-Wunused-but-set-variable]

Check warning on line 541 in bitmap/tga.cpp

GitHub Actions / Linux-x64, Release

variable ‘data8bit’ set but not used [-Wunused-but-set-variable]

Check warning on line 541 in bitmap/tga.cpp

GitHub Actions / Linux-x64-clang, Debug

variable 'data8bit' set but not used [-Wunused-but-set-variable]

Check warning on line 541 in bitmap/tga.cpp

GitHub Actions / Linux-cross-arm64, Debug

variable ‘data8bit’ set but not used [-Wunused-but-set-variable]
int mipped = 0, file_mipped = 0;
int num_mips = 1;
char name[BITMAP_NAME_LEN];
str[0] = ddio_KeyToAscii(keypressed);
str[1] = 0;
if (str[0] != 255) {
Con_raw_inp_buf[Con_raw_inp_pos] = str[0];

Check warning on line 129 in linux/lnxcon_raw.cpp

GitHub Actions / Linux-x64, Debug

array subscript has type ‘char’ [-Wchar-subscripts]

Check warning on line 129 in linux/lnxcon_raw.cpp

GitHub Actions / Linux-x64-clang, Debug

array subscript is of type 'char' [-Wchar-subscripts]

Check warning on line 129 in linux/lnxcon_raw.cpp

GitHub Actions / Linux-cross-arm64, Debug

array subscript has type ‘char’ [-Wchar-subscripts]
Con_raw_inp_buf[Con_raw_inp_pos + 1] = '\0';
Con_raw_inp_pos++;
con_raw_Puts(-1, (const char *)str);
// put some data up on the screen
void con_raw_Puts(int window, const char *str) {
fprintf(stdout, str);

Check warning on line 177 in linux/lnxcon_raw.cpp

GitHub Actions / Linux-x64, Debug

format not a string literal and no format arguments [-Wformat-security]

Check warning on line 177 in linux/lnxcon_raw.cpp

GitHub Actions / Linux-cross-arm64, Debug

format not a string literal and no format arguments [-Wformat-security]
fflush(stdout);
}
// Parses a quoted string
// Returns true if got string ok, else false
char *ParseString(char *p, char *buf, int bufsize, char sdelim, char edelim) {
char *save_p;

Check warning on line 82 in linux/registry.cpp

GitHub Actions / Linux-x64, Debug

variable ‘save_p’ set but not used [-Wunused-but-set-variable]
p = SkipWhite(p);
// Parses a sequence of non-space characters
char *ParseToken(char *p, char *buf, int bufsize) {
char *save_p;

Check warning on line 116 in linux/registry.cpp

GitHub Actions / Linux-x64, Debug

variable ‘save_p’ set but not used [-Wunused-but-set-variable]
p = SkipWhite(p);
save_p = p;
case SURFTYPE_MEMORY:
grerr = (bool)gr_mem_surf_Create(&ddsfObj);
break;
default:

Check warning on line 177 in 2dlib/surface.cpp

GitHub Actions / Linux-x64-clang, Release

variable 'grerr' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
Int3(); // Invalid!!
}
if (!grerr)
case UID_OK: // start game
exit_menu = true;
DLLEditGetText(virus_pk_edit, tempbuffer, 20);
int newpk = atoi(tempbuffer);

Check warning on line 170 in netgames/entropy/EntropyRoom.cpp

GitHub Actions / Linux-cross-arm64, Release

unused variable ‘newpk’ [-Wunused-variable]
DLLmprintf(0, "New Virus/Kill = %d\n", newpk);
break;
};
snprintf(tempbuffer, sizeof(tempbuffer), "%d)", count);
memcpy(&buffer[0], tempbuffer, strlen(tempbuffer));
snprintf(tempbuffer, sizeof(tempbuffer), "%s%s", (pr->state == STATE_INGAME) ? "" : "*", pr->callsign);

Check warning on line 1077 in netgames/hoard/hoard.cpp

GitHub Actions / Linux-cross-arm64, Release

‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
memcpy(&buffer[7], tempbuffer, strlen(tempbuffer));
if (ps) {
}
if ((WhoJustScored != pr->pnum) || (DisplayBlink)) {
DLLgrtext_SetColor(color);

Check warning on line 1328 in netgames/hoard/hoard.cpp

GitHub Actions / Linux-cross-arm64, Release

‘color’ may be used uninitialized in this function [-Wmaybe-uninitialized]
DLLgrtext_Printf(name_x, y, name);
DLLgrtext_Printf(score_x, y, "%d", (stat) ? stat->Score[DSTAT_LEVEL] : 0);
}
// Displays HUD scores
static void DisplayHUDScores(struct tHUDItem *hitem);
// Displays the Stats screen
static void DisplayScores(void);

Check warning on line 129 in netgames/hyperanarchy/hyperanarchy.cpp

GitHub Actions / Linux-cross-arm64, Release

‘void DisplayScores()’ declared ‘static’ but never defined [-Wunused-function]

Check warning on line 129 in netgames/hyperanarchy/hyperanarchy.cpp

GitHub Actions / Linux-cross-arm64, Debug

‘void DisplayScores()’ declared ‘static’ but never defined [-Wunused-function]
// Sorts based on score
static void SortPlayerScores(int *sortedindex, int size);
// Updates the effect on all the players
// Displays the Welcome Screen
static void DisplayWelcomeScreen(int pnum);
// Handler for menu item for turning on/off blinking hud
static void SwitchBlinkingHud(int i);

Check warning on line 137 in netgames/hyperanarchy/hyperanarchy.cpp

GitHub Actions / Linux-cross-arm64, Release

‘void SwitchBlinkingHud(int)’ declared ‘static’ but never defined [-Wunused-function]

Check warning on line 137 in netgames/hyperanarchy/hyperanarchy.cpp

GitHub Actions / Linux-cross-arm64, Debug

‘void SwitchBlinkingHud(int)’ declared ‘static’ but never defined [-Wunused-function]
// Generates a valid random room
static int GetRandomValidRoom(void);
// Moves the HyperOrb to the center of a random room
snprintf(tempbuffer, sizeof(tempbuffer), "%d)", count);
memcpy(&buffer[0], tempbuffer, strlen(tempbuffer));
snprintf(tempbuffer, sizeof(tempbuffer), "%s%s", (pr->state == STATE_INGAME) ? "" : "*", pr->callsign);

Check warning on line 954 in netgames/hyperanarchy/hyperanarchy.cpp

GitHub Actions / Linux-cross-arm64, Release

‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
memcpy(&buffer[7], tempbuffer, strlen(tempbuffer));
if (ps) {
end++;
// Set output size to minimum of trimmed string length and buffer size minus 1
out_size = (end - src) < destlen - 1 ? (end - src) : destlen - 1;

Check warning on line 74 in misc/pstring.cpp

GitHub Actions / Windows-x64, Debug

'<': signed/unsigned mismatch

Check warning on line 74 in misc/pstring.cpp

GitHub Actions / Windows-x64, Release

'<': signed/unsigned mismatch
// Copy trimmed string and add null terminator
std::memcpy(dest, src, out_size);
return false;
}
#else
if (GetModuleFileName(NULL, exec_path, len) == 0) {

Check warning on line 127 in ddio/lnxio.cpp

GitHub Actions / Windows-x64, Debug

'argument': conversion from 'size_t' to 'DWORD', possible loss of data

Check warning on line 127 in ddio/lnxio.cpp

GitHub Actions / Windows-x64, Release

'argument': conversion from 'size_t' to 'DWORD', possible loss of data
DWORD error = GetLastError();
LOG_ERROR << "GetModuleFileName failed!";
return false;
std::ifstream lockfile(lock_filename, std::ios::binary);
lockfile >> lock_content;
lockfile.close();
} catch (std::exception &e) {

Check warning on line 66 in ddio/file.cpp

GitHub Actions / Windows-x64, Debug

'e': unreferenced local variable

Check warning on line 66 in ddio/file.cpp

GitHub Actions / Windows-x64, Release

'e': unreferenced local variable
return false;
}
std::ofstream lockfile(lock_filename, std::ios::binary);
lockfile << lock_content;
lockfile.close();
} catch (std::exception &e) {

Check warning on line 100 in ddio/file.cpp

GitHub Actions / Windows-x64, Debug

'e': unreferenced local variable

Check warning on line 100 in ddio/file.cpp

GitHub Actions / Windows-x64, Release

'e': unreferenced local variable
return false;
}
std::ifstream lockfile(lock_filename, std::ios::binary);
lockfile >> lock_content;
lockfile.close();
} catch (std::exception &e) {

Check warning on line 122 in ddio/file.cpp

GitHub Actions / Windows-x64, Debug

'e': unreferenced local variable

Check warning on line 122 in ddio/file.cpp

GitHub Actions / Windows-x64, Release

'e': unreferenced local variable
return false;
}
char *random_name = (char *)mem_malloc(len_result + len + strlen(ext) + 1);
strncpy(random_name, (basedir / prefix).u8string().c_str(), len_result);
srand(D3::ChronoTimer::GetTimeMS());

Check warning on line 176 in ddio/file.cpp

GitHub Actions / Windows-x64, Debug

'argument': conversion from 'int64_t' to 'unsigned int', possible loss of data

Check warning on line 176 in ddio/file.cpp

GitHub Actions / Windows-x64, Release

'argument': conversion from 'int64_t' to 'unsigned int', possible loss of data
int tries = 20;
while (tries > 0) {
// Search component in search_path
auto const &it = std::filesystem::directory_iterator(search_path);
auto found = std::find_if(it, end(it), [&search_file, &search_path, &result](const auto& dir_entry) {

Check warning on line 129 in cfile/cfile.cpp

GitHub Actions / macOS-Intel, Debug

lambda capture 'search_path' is not used [-Wunused-lambda-capture]

Check warning on line 129 in cfile/cfile.cpp

GitHub Actions / macOS-Intel, Debug

lambda capture 'result' is not used [-Wunused-lambda-capture]

Check warning on line 129 in cfile/cfile.cpp

GitHub Actions / macOS-Intel, Release

lambda capture 'search_path' is not used [-Wunused-lambda-capture]

Check warning on line 129 in cfile/cfile.cpp

GitHub Actions / macOS-Intel, Release

lambda capture 'result' is not used [-Wunused-lambda-capture]
return stricmp(dir_entry.path().filename().u8string().c_str(), search_file.u8string().c_str()) == 0;
});
std::vector<std::filesystem::path> cf_LocatePathMultiplePathsHelper(const std::filesystem::path &relative_path,
bool stop_after_first_result) {
ASSERT(("realative_path should be a relative path.", relative_path.is_relative()));

Check warning on line 148 in cfile/cfile.cpp

GitHub Actions / macOS-Intel, Debug

left operand of comma operator has no effect [-Wunused-value]
std::vector<std::filesystem::path> return_value = { };
for (auto base_directories_iterator = Base_directories.rbegin();
base_directories_iterator != Base_directories.rend();
// open the file for reading
FILE *fp;
int r;

Check warning on line 389 in cfile/cfile.cpp

GitHub Actions / macOS-Intel, Release

variable 'r' set but not used [-Wunused-but-set-variable]
// See if there's an available FILE
if (lib->file) {
fp = lib->file;