Skip to content

Commit 5665d32

Browse files
authored
Merge pull request #7137 from BOINC/vko_revert_merge
Revert "Merge pull request #7134 from BOINC/vko_fix_compile_warnings"
2 parents d2b3ff7 + 667484e commit 5665d32

48 files changed

Lines changed: 659 additions & 750 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/boinc_api.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
2+
// http://boinc.berkeley.edu
3+
// Copyright (C) 2008 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -252,10 +252,8 @@ static std::vector<UPLOAD_FILE_STATUS> upload_file_status;
252252

253253
static int resume_activities();
254254
static void boinc_exit(int);
255-
#ifndef _WIN32
256255
static void block_sigalrm();
257256
static int start_worker_signals();
258-
#endif
259257

260258
char* boinc_msg_prefix(char* sbuf, int len) {
261259
#ifdef ANDROID
@@ -290,7 +288,7 @@ char* boinc_msg_prefix(char* sbuf, int len) {
290288
return sbuf;
291289
}
292290
#ifdef _WIN32
293-
n = _snprintf(sbuf, len, "%s (%ld):", buf, GetCurrentProcessId());
291+
n = _snprintf(sbuf, len, "%s (%d):", buf, GetCurrentProcessId());
294292
#else
295293
n = snprintf(sbuf, len, "%s (%d):", buf, getpid());
296294
#endif
@@ -1213,7 +1211,7 @@ static void handle_upload_file_status() {
12131211
int status;
12141212
const size_t prefix_len = strlen(UPLOAD_FILE_STATUS_PREFIX);
12151213

1216-
relative_to_absolute("", path, MAXPATHLEN);
1214+
relative_to_absolute("", path);
12171215
DirScanner dirscan(path);
12181216
while (dirscan.scan(filename)) {
12191217
strlcpy(buf, filename.c_str(), sizeof(buf));
@@ -1729,7 +1727,7 @@ int boinc_receive_trickle_down(char* buf, int len) {
17291727
handle_trickle_downs = true;
17301728

17311729
if (have_trickle_down) {
1732-
relative_to_absolute("", path, MAXPATHLEN);
1730+
relative_to_absolute("", path);
17331731
DirScanner dirscan(path);
17341732
while (dirscan.scan(filename)) {
17351733
if (strstr(filename.c_str(), "trickle_down")) {

client/app.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
2+
// http://boinc.berkeley.edu
3+
// Copyright (C) 2022 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -294,7 +294,7 @@ int ACTIVE_TASK::init(RESULT* rp) {
294294
max_disk_usage = rp->wup->rsc_disk_bound;
295295
max_mem_usage = rp->wup->rsc_memory_bound;
296296
get_slot_dir(slot, slot_dir, sizeof(slot_dir));
297-
relative_to_absolute(slot_dir, slot_path, MAXPATHLEN);
297+
relative_to_absolute(slot_dir, slot_path);
298298
return 0;
299299
}
300300
#endif

client/app_start.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
2+
// http://boinc.berkeley.edu
3+
// Copyright (C) 2022 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -207,7 +207,7 @@ void ACTIVE_TASK::init_app_init_data(APP_INIT_DATA& aid) {
207207
safe_strcpy(aid.user_name, project->user_name);
208208
safe_strcpy(aid.team_name, project->team_name);
209209
safe_strcpy(aid.project_dir, project->project_dir_absolute());
210-
relative_to_absolute("", aid.boinc_dir, MAXPATHLEN);
210+
relative_to_absolute("", aid.boinc_dir);
211211
safe_strcpy(aid.authenticator, project->authenticator);
212212
aid.slot = slot;
213213
#ifdef _WIN32
@@ -764,7 +764,7 @@ int ACTIVE_TASK::start() {
764764
}
765765
}
766766

767-
relative_to_absolute(slot_dir, slotdirpath, MAXPATHLEN);
767+
relative_to_absolute(slot_dir, slotdirpath);
768768
int prio_mask;
769769
if (cc_config.no_priority_change) {
770770
prio_mask = 0;

client/async_file.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
2+
// http://boinc.berkeley.edu
3+
// Copyright (C) 2012 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -72,7 +72,7 @@ int ASYNC_COPY::init(
7272
// to env var for temp directory; don't want this.
7373
//
7474
char dir[MAXPATHLEN];
75-
boinc_path_to_dir(to_path, dir, MAXPATHLEN);
75+
boinc_path_to_dir(to_path, dir);
7676
#ifdef _WIN32
7777
out = boinc_temp_file(dir, "cpy", temp_path, fip->nbytes);
7878
#else
@@ -189,7 +189,7 @@ int ASYNC_VERIFY::init(FILE_INFO* _fip) {
189189
if (fip->download_gzipped) {
190190
safe_strcpy(outpath, inpath);
191191
char dir[MAXPATHLEN];
192-
boinc_path_to_dir(outpath, dir, MAXPATHLEN);
192+
boinc_path_to_dir(outpath, dir);
193193
#ifdef _WIN32
194194
out = boinc_temp_file(dir, "vfy", temp_path, fip->nbytes);
195195
#else

client/client_state.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
22
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
3+
// Copyright (C) 2024 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -543,7 +543,7 @@ int CLIENT_STATE::init() {
543543
#endif
544544
}
545545

546-
relative_to_absolute("", buf, MAXPATHLEN);
546+
relative_to_absolute("", buf);
547547
msg_printf(NULL, MSG_INFO, "Data directory: %s", buf);
548548

549549
#ifdef _WIN32

client/client_types.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
2+
// http://boinc.berkeley.edu
33
// Copyright (C) 2026 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
@@ -1144,7 +1144,7 @@ void APP_VERSION::check_graphics_exec() {
11441144

11451145
char relpath[MAXPATHLEN], path[MAXPATHLEN];
11461146
get_pathname(graphics_exec_fip, relpath, sizeof(relpath));
1147-
relative_to_absolute(relpath, path, MAXPATHLEN);
1147+
relative_to_absolute(relpath, path);
11481148
#ifdef __APPLE__
11491149
if (!can_run_on_this_CPU(path)) {
11501150
// if can't run this exec, don't check again

client/gui_rpc_server_ops.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
2+
// http://boinc.berkeley.edu
3+
// Copyright (C) 2022 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -2108,7 +2108,7 @@ int GUI_RPC_CONN::handle_rpc() {
21082108
if (!http_request) {
21092109
mfout.printf("\003"); // delimiter for non-HTTP replies
21102110
}
2111-
size_t n;
2111+
int n;
21122112
mout.get_buf(p, n);
21132113
if (http_request) {
21142114
char buf[1024];
@@ -2121,14 +2121,14 @@ int GUI_RPC_CONN::handle_rpc() {
21212121
"Access-Control-Allow-Headers: *\n"
21222122
"Connection: close\n"
21232123
"Content-Type: text/xml; charset=utf-8\n"
2124-
"Content-Length: %zu\n\n"
2124+
"Content-Length: %d\n\n"
21252125
XML_HEADER,
2126-
n+strlen(XML_HEADER)
2126+
n+(int)strlen(XML_HEADER)
21272127
);
21282128
send(sock, buf, (int)strlen(buf), 0);
21292129
}
21302130
if (p) {
2131-
send(sock, p, (int)n, 0);
2131+
send(sock, p, n, 0);
21322132
if (log_flags.gui_rpc_debug) {
21332133
if (!http_request) {
21342134
p[n-1]=0; // replace 003 with NULL

client/project.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
2+
// http://boinc.berkeley.edu
3+
// Copyright (C) 2012 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -939,7 +939,7 @@ const char* PROJECT::project_dir() {
939939

940940
const char* PROJECT::project_dir_absolute() {
941941
if (_project_dir_absolute[0] == 0) {
942-
relative_to_absolute(project_dir(), _project_dir_absolute, MAXPATHLEN);
942+
relative_to_absolute(project_dir(), _project_dir_absolute);
943943
}
944944
return _project_dir_absolute;
945945
}

lib/Makefile.mingw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ HAVEFLAGS = -DHAVE_STRCASECMP
141141
WINVERFLAGS = -D_WINDOWS -D_MT -D_WIN32 -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500
142142
CCXXFLAGS = $(INCS) $(DEBUG) --include $(BOINC_SRC)/version.h \
143143
$(HAVEFLAGS) $(WINVERFLAGS) -DBOINC \
144-
-DNODB -D_CONSOLE -fexceptions -Wall $(OPTFLAGS) $(NOCYGWIN)
144+
-DNODB -D_CONSOLE -fexceptions $(OPTFLAGS) $(NOCYGWIN)
145145

146146
# flags for compiling boinc_zip
147147
ZIP_VCPROJ_FLAGS = -DWIN32 -D_LIB -DDLL -D_CRT_SECURE_NO_WARNINGS

lib/boinc_stdio.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
22
// https://boinc.berkeley.edu
3-
// Copyright (C) 2026 University of California
3+
// Copyright (C) 2025 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -59,14 +59,6 @@ namespace boinc {
5959
inline FILE* fopen(const char* path, const char* mode) {
6060
#ifdef _USING_FCGI_
6161
return FCGI_fopen(path, mode);
62-
#elif defined(_MSC_VER)
63-
FILE *f;
64-
if (::fopen_s(&f, path, mode) == 0) {
65-
return f;
66-
}
67-
else {
68-
return nullptr;
69-
}
7062
#else
7163
return ::fopen(path, mode);
7264
#endif
@@ -138,11 +130,9 @@ namespace boinc {
138130

139131
inline FILE* fdopen(int fd, const char *mode) {
140132
#ifdef _USING_FCGI_
141-
return FCGI_fdopen(fd, mode);
142-
#elif defined(_MSC_VER)
143-
return ::_fdopen(fd, mode);
133+
return FCGI_fdopen(fd,mode);
144134
#else
145-
return ::fdopen(fd, mode);
135+
return ::fdopen(fd,mode);
146136
#endif
147137
}
148138

@@ -197,14 +187,6 @@ namespace boinc {
197187
inline FILE* freopen(const char *path, const char *mode, FILE *file) {
198188
#ifdef _USING_FCGI_
199189
return FCGI_freopen(path,mode,file);
200-
#elif defined(_MSC_VER)
201-
FILE *f;
202-
if (::freopen_s(&f, path, mode, file) == 0) {
203-
return f;
204-
}
205-
else {
206-
return nullptr;
207-
}
208190
#else
209191
return ::freopen(path,mode,file);
210192
#endif

0 commit comments

Comments
 (0)