mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-26 06:45:37 +03:00
Fixed clang warnings when neither the assembly interpreter nor JIT are enabled (bug 5601, r=dvander).
Former-commit-id: fd100b2fa7
This commit is contained in:
parent
e3d750597a
commit
e414ede098
@ -1640,7 +1640,7 @@ int AMXAPI amx_PushString(AMX *amx, cell *amx_addr, cell **phys_addr, const char
|
|||||||
* fast "indirect threaded" interpreter.
|
* fast "indirect threaded" interpreter.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NEXT(cip) goto **cip++
|
#define NEXT(cip) goto *(const void *)*cip++
|
||||||
|
|
||||||
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index)
|
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index)
|
||||||
{
|
{
|
||||||
@ -1824,14 +1824,14 @@ static const void * const amx_opcodelist[] = {
|
|||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_load_i:
|
op_load_i:
|
||||||
/* verify address */
|
/* verify address */
|
||||||
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp)
|
if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
pri= * (cell *)(data+(int)pri);
|
pri= * (cell *)(data+(int)pri);
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_lodb_i:
|
op_lodb_i:
|
||||||
GETPARAM(offs);
|
GETPARAM(offs);
|
||||||
/* verify address */
|
/* verify address */
|
||||||
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp)
|
if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
switch (offs) {
|
switch (offs) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1897,14 +1897,14 @@ static const void * const amx_opcodelist[] = {
|
|||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_stor_i:
|
op_stor_i:
|
||||||
/* verify address */
|
/* verify address */
|
||||||
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp)
|
if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
*(cell *)(data+(int)alt)=pri;
|
*(cell *)(data+(int)alt)=pri;
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_strb_i:
|
op_strb_i:
|
||||||
GETPARAM(offs);
|
GETPARAM(offs);
|
||||||
/* verify address */
|
/* verify address */
|
||||||
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp)
|
if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
switch (offs) {
|
switch (offs) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1921,7 +1921,7 @@ static const void * const amx_opcodelist[] = {
|
|||||||
op_lidx:
|
op_lidx:
|
||||||
offs=pri*sizeof(cell)+alt;
|
offs=pri*sizeof(cell)+alt;
|
||||||
/* verify address */
|
/* verify address */
|
||||||
if (offs>=hea && offs<stk || (ucell)offs>=(ucell)amx->stp)
|
if ((offs>=hea && offs<stk) || (ucell)offs>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
pri= * (cell *)(data+(int)offs);
|
pri= * (cell *)(data+(int)offs);
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
@ -1929,7 +1929,7 @@ static const void * const amx_opcodelist[] = {
|
|||||||
GETPARAM(offs);
|
GETPARAM(offs);
|
||||||
offs=(pri << (int)offs)+alt;
|
offs=(pri << (int)offs)+alt;
|
||||||
/* verify address */
|
/* verify address */
|
||||||
if (offs>=hea && offs<stk || (ucell)offs>=(ucell)amx->stp)
|
if ((offs>=hea && offs<stk) || (ucell)offs>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
pri= * (cell *)(data+(int)offs);
|
pri= * (cell *)(data+(int)offs);
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
@ -2366,13 +2366,13 @@ static const void * const amx_opcodelist[] = {
|
|||||||
/* verify top & bottom memory addresses, for both source and destination
|
/* verify top & bottom memory addresses, for both source and destination
|
||||||
* addresses
|
* addresses
|
||||||
*/
|
*/
|
||||||
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp)
|
if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if ((pri+offs)>hea && (pri+offs)<stk || (ucell)(pri+offs)>(ucell)amx->stp)
|
if (((pri+offs)>hea && (pri+offs)<stk) || (ucell)(pri+offs)>(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp)
|
if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if ((alt+offs)>hea && (alt+offs)<stk || (ucell)(alt+offs)>(ucell)amx->stp)
|
if (((alt+offs)>hea && (alt+offs)<stk) || (ucell)(alt+offs)>(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
memcpy(data+(int)alt, data+(int)pri, (int)offs);
|
memcpy(data+(int)alt, data+(int)pri, (int)offs);
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
@ -2381,22 +2381,22 @@ static const void * const amx_opcodelist[] = {
|
|||||||
/* verify top & bottom memory addresses, for both source and destination
|
/* verify top & bottom memory addresses, for both source and destination
|
||||||
* addresses
|
* addresses
|
||||||
*/
|
*/
|
||||||
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp)
|
if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if ((pri+offs)>hea && (pri+offs)<stk || (ucell)(pri+offs)>(ucell)amx->stp)
|
if (((pri+offs)>hea && (pri+offs)<stk) || (ucell)(pri+offs)>(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp)
|
if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if ((alt+offs)>hea && (alt+offs)<stk || (ucell)(alt+offs)>(ucell)amx->stp)
|
if (((alt+offs)>hea && (alt+offs)<stk) || (ucell)(alt+offs)>(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
pri=memcmp(data+(int)alt, data+(int)pri, (int)offs);
|
pri=memcmp(data+(int)alt, data+(int)pri, (int)offs);
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_fill:
|
op_fill:
|
||||||
GETPARAM(offs);
|
GETPARAM(offs);
|
||||||
/* verify top & bottom memory addresses */
|
/* verify top & bottom memory addresses */
|
||||||
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp)
|
if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
if ((alt+offs)>hea && (alt+offs)<stk || (ucell)(alt+offs)>(ucell)amx->stp)
|
if (((alt+offs)>hea && (alt+offs)<stk) || (ucell)(alt+offs)>(ucell)amx->stp)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
for (i=(int)alt; offs>=(int)sizeof(cell); i+=sizeof(cell), offs-=sizeof(cell))
|
for (i=(int)alt; offs>=(int)sizeof(cell); i+=sizeof(cell), offs-=sizeof(cell))
|
||||||
*(cell *)(data+i) = pri;
|
*(cell *)(data+i) = pri;
|
||||||
|
Loading…
Reference in New Issue
Block a user