Skip to content

Commit

Permalink
(cherrypick) small part of: [26870862f0]: Wrong sentinel in Tcl_SetEr…
Browse files Browse the repository at this point in the history
…rorCode usage; Handle any C++-compiler as well
  • Loading branch information
jan.nijtmans committed Oct 20, 2023
1 parent c28fb81 commit 0da684f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compat/zlib/contrib/minizip/crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int update_keys(unsigned long* pkeys, const z_crc_t* pcrc_32_tab, int c)
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{
register int keyshift = (int)((*(pkeys+1)) >> 24);
int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
}
return c;
Expand Down
4 changes: 2 additions & 2 deletions libtommath/bn_mp_div.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
}

/* init our temps */
if ((err = mp_init_multi(&ta, &tb, &tq, &q, NULL)) != MP_OKAY) {
if ((err = mp_init_multi(&ta, &tb, &tq, &q, (void *)NULL)) != MP_OKAY) {
return err;
}

Expand Down Expand Up @@ -64,7 +64,7 @@ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
d->sign = MP_IS_ZERO(d) ? MP_ZPOS : n;
}
LBL_ERR:
mp_clear_multi(&ta, &tb, &tq, &q, NULL);
mp_clear_multi(&ta, &tb, &tq, &q, (void *)NULL);
return err;
}

Expand Down
4 changes: 2 additions & 2 deletions libtommath/bn_s_mp_balance_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c)
if ((err = mp_init_size(&a0, bsize + 2)) != MP_OKAY) {
return err;
}
if ((err = mp_init_multi(&tmp, &r, NULL)) != MP_OKAY) {
if ((err = mp_init_multi(&tmp, &r, (void *)NULL)) != MP_OKAY) {
mp_clear(&a0);
return err;
}
Expand Down Expand Up @@ -75,7 +75,7 @@ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c)

mp_exch(&r,c);
LBL_ERR:
mp_clear_multi(&a0, &tmp, &r,NULL);
mp_clear_multi(&a0, &tmp, &r, (void *)NULL);
return err;
}
#endif
4 changes: 2 additions & 2 deletions libtommath/bn_s_mp_toom_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mp_err s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c)
mp_err err;

/* init temps */
if ((err = mp_init_multi(&S1, &S2, &T1, NULL)) != MP_OKAY) {
if ((err = mp_init_multi(&S1, &S2, &T1, (void *)NULL)) != MP_OKAY) {
return err;
}

Expand Down Expand Up @@ -208,7 +208,7 @@ mp_err s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c)
LBL_ERRa1:
mp_clear(&a0);
LBL_ERRa0:
mp_clear_multi(&S1, &S2, &T1, NULL);
mp_clear_multi(&S1, &S2, &T1, (void *)NULL);
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion unix/dltest/pkgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Pkgb_SubObjCmd(
|| (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) {
char buf[TCL_INTEGER_SPACE];
snprintf(buf, sizeof(buf), "%d", Tcl_GetErrorLine(interp));
Tcl_AppendResult(interp, " in line: ", buf, NULL);
Tcl_AppendResult(interp, " in line: ", buf, (void *)NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));
Expand Down
6 changes: 3 additions & 3 deletions unix/dltest/pkgooa.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ Pkgooa_Init(
}
if (tclStubsPtr == NULL) {
Tcl_AppendResult(interp, "Tcl stubs are not initialized, "
"did you compile using -DUSE_TCL_STUBS? ", NULL);
"did you compile using -DUSE_TCL_STUBS? ", (void *)NULL);
return TCL_ERROR;
}
if (Tcl_OOInitStubs(interp) == NULL) {
return TCL_ERROR;
}
if (tclOOStubsPtr == NULL) {
Tcl_AppendResult(interp, "TclOO stubs are not initialized", NULL);
Tcl_AppendResult(interp, "TclOO stubs are not initialized", (void *)NULL);
return TCL_ERROR;
}
if (tclOOIntStubsPtr == NULL) {
Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", NULL);
Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", (void *)NULL);
return TCL_ERROR;
}

Expand Down

0 comments on commit 0da684f

Please sign in to comment.