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

runtime: remove some build warnings #391

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ src/iconc/iconc
src/runtime/uniconx
src/runtime/uniconc
src/iconc/uniconc

src/runtime/rt.db

# runtime rrt tmp files
src/runtime/f*.c
src/runtime/o_*.c
src/runtime/x*.c

#rt dir
rt/**

Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
"**/*.so": true,
"**/*.o": true,
"**/*.u": true,
"**/*.tmp": true,
"config.status": true,
"**/uniclass.*": true
"**/uniclass.*": true,
"src/runtime/f*.c": true,
"src/runtime/o_*.c": true,
"src/runtime/x*.c": true
},
"C_Cpp.default.includePath": [
"${default}",
Expand Down
6 changes: 6 additions & 0 deletions src/h/rmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -2040,3 +2040,9 @@
* Macro definition used by pollevent() to avoid magic numbers
*/
#define POLL_INTERVAL 400

#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
#define vfork fork
#endif
#endif
3 changes: 3 additions & 0 deletions src/libtp/tpdssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ void init_openssl() {
#endif
SSL_load_error_strings();
/*OPENSSL_config(NULL); */
#if OPENSSL_VERSION_NUMBER < 0x30000000L
/* Needed only in older versions*/
ERR_load_BIO_strings();
#endif
OpenSSL_add_all_algorithms();

/*
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/fxposix.ri
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ function{0, 1} ready(f, i)
return string
}
body {
int status, fd;
int status;
tended struct descrip desc;
status = BlkD(f,File)->status;

Expand Down Expand Up @@ -3129,7 +3129,7 @@ function{0, 1} ready(f, i)
if (select(pt->master_fd+1, &readset, NULL, NULL, &tv) > 0) {
/* performance bug: how many bytes are really available? */
tb = 1;
#endif
#endif /* NT */
if (i == 0) i = tb;
else if (tb < i) i = tb;
Protect(sbuf = alcstr(NULL, i), runerr(0));
Expand All @@ -3138,7 +3138,7 @@ function{0, 1} ready(f, i)
#else
tb = read(pt->master_fd, sbuf, i);
status = (tb != -1);
#endif
#endif /* NT */
if (!status) fail;
StrLoc(desc) = sbuf;
StrLen(desc) = tb;
Expand Down
5 changes: 1 addition & 4 deletions src/runtime/lmisc.r
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ operator{0,1} <@ rcv(x,y)
}
#ifdef PosixFns
else if is:file(y) then inline {
int status, fd, i=0;
int status, i=0;
tended struct descrip desc;
status = BlkD(y, File)->status;

Expand Down Expand Up @@ -902,9 +902,6 @@ operator{0,1} <<@ rcvbk(x,y)
int status;
char sbuf[MaxReadStr];
tended struct descrip s;
#ifdef PosixFns
SOCKET ws;
#endif /* PosixFns */

status = BlkLoc(y)->File.status;

Expand Down
6 changes: 3 additions & 3 deletions src/runtime/rdebug.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void tracebk(struct pf_marker *lcl_pfp, dptr argp, FILE *logfptr)
#if COMPILER
struct debug *debug;
#else /* COMPILER */
long depth = 0, iteration = 0;
//long depth = 0, iteration = 0;
struct pf_marker *origpfp;
dptr arg;
inst cipc;
Expand All @@ -55,7 +55,7 @@ void tracebk(struct pf_marker *lcl_pfp, dptr argp, FILE *logfptr)

for (pfp->pf_efp = NULL; pfp->pf_pfp != NULL; pfp = pfp->pf_pfp) {
(pfp->pf_pfp)->pf_efp = (struct ef_marker *)pfp;
depth++;
//depth++;
}

/* Now start from the base procedure frame marker, producing a listing
Expand Down Expand Up @@ -88,7 +88,7 @@ void tracebk(struct pf_marker *lcl_pfp, dptr argp, FILE *logfptr)
}

pfp = (struct pf_marker *)(pfp->pf_efp);
iteration++;
//iteration++;
}
#endif /* COMPILER */
}
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/rposix.r
Original file line number Diff line number Diff line change
Expand Up @@ -1586,9 +1586,8 @@ SSL_CTX * create_ssl_context(dptr attr, int n, int type ) {
tended char *certFile=NULL, *keyFile=NULL, *ciphers=NULL, *ciphers13=NULL, *password=NULL;
tended char *ca_file=NULL, *ca_dir=NULL, *ca_store=NULL;
tended char *min_proto=NULL, *max_proto=NULL, *verifyPeer=NULL;
int old_ssl_flags=0;
static int SSL_is_initialized = 0;
C_integer timeout = 0, timeout_set = 0;
C_integer timeout = 0;
int count;
int a;

Expand All @@ -1600,7 +1599,7 @@ SSL_CTX * create_ssl_context(dptr attr, int n, int type ) {
attr[a] = emptystr;
}
else if (a==0 && cnv:C_integer(attr[a], timeout)) {
timeout_set = 1;
//timeout_set = 1;
}
else if (cnv:C_string(attr[a], tmps)) {
/*
Expand Down Expand Up @@ -1725,7 +1724,6 @@ SSL_CTX * create_ssl_context(dptr attr, int n, int type ) {
#endif

count = 2;
old_ssl_flags = 0;
do {
char *proto;
if (count == 2)
Expand Down Expand Up @@ -1777,6 +1775,7 @@ SSL_CTX * create_ssl_context(dptr attr, int n, int type ) {

if (count == 2) {
#if !defined(MacOS) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
int old_ssl_flags=0;
switch (ver) {
case TLS1_2_VERSION: old_ssl_flags |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 |
SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; break;
Expand All @@ -1799,6 +1798,7 @@ SSL_CTX * create_ssl_context(dptr attr, int n, int type ) {
}
else {
#if !defined(MacOS) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
int old_ssl_flags=0;
switch (ver) {
case TLS1_2_VERSION: break;
case TLS1_1_VERSION: old_ssl_flags |= SSL_OP_NO_TLSv1_2; break;
Expand Down
7 changes: 4 additions & 3 deletions src/runtime/rxwin.ri
Original file line number Diff line number Diff line change
Expand Up @@ -4060,7 +4060,8 @@ int strimage(wbp w,
}
}
else {
int lastr=-1, lastg=-1, lastb=-1, count = 0;
int lastr=-1, lastg=-1, lastb=-1;
//int count = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been looking at the history of this block of code. count was introduced by commit f1c1257 in 2007. It wasn't used then (except to be incremented for no apparent purpose) and it has never been used up to today. I'm content for you to comment it out, but I wonder why we don't just delete it.

wclrp cp;
iy = 0;

Expand All @@ -4077,7 +4078,7 @@ int strimage(wbp w,
int g = *s++ * 257;
int b = *s++ * 257;
if (r==lastr && g == lastg && b == lastb){
count++;
//count++;
}
else{
cp = (wclrp) alc_rgbTrueColor(w, r, g, b);
Expand All @@ -4095,7 +4096,7 @@ int strimage(wbp w,
int g = *s++ * 257;
int b = *s++ * 257;
if (r==lastr && g == lastg && b == lastb){
count++;
//count++;
}
else
cp = alc_rgb2(w,"anon", r, g, b);
Expand Down
Loading