Branch: Tag:

2016-01-26

2016-01-26 21:08:15 by Martin Nilsson <nilsson@fastmail.com>

SIMPLE_TOO_FEW_ARGS_ERROR should be SIMPLE_WRONG_NUM_ARGS_ERROR since long ago. Replaced them and tighten up argument control in places.

1104:    switch(args) \    { \    case 0: case 1: \ -  SIMPLE_TOO_FEW_ARGS_ERROR(NAME, 2); \ +  SIMPLE_WRONG_NUM_ARGS_ERROR(NAME, 2); \    case 2: \    i=FUN (sp-2,sp-1); \    pop_n_elems(2); \
1470:    default:    if(!args)    { -  SIMPLE_TOO_FEW_ARGS_ERROR("`+", 1); +  SIMPLE_WRONG_NUM_ARGS_ERROR("`+", 1);    }else{    if(types & BIT_OBJECT)    {
2466:   {    switch(args)    { -  case 0: SIMPLE_TOO_FEW_ARGS_ERROR("`-", 1); +  case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`-", 1);    case 1: o_negate(); break;    case 2: o_subtract(); break;    default:
2849:   {    switch(args)    { -  case 0: SIMPLE_TOO_FEW_ARGS_ERROR("`&", 1); +  case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`&", 1);    case 1: return;    case 2: o_and(); return;    default:
3104:   {    switch(args)    { -  case 0: SIMPLE_TOO_FEW_ARGS_ERROR("`|", 1); +  case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`|", 1);    case 1: return;    case 2: o_or(); return;    default:
3349:   {    switch(args)    { -  case 0: SIMPLE_TOO_FEW_ARGS_ERROR("`^", 1); +  case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`^", 1);    case 1: return;    case 2: o_xor(); return;    default:
3453:    */   PMOD_EXPORT void f_lsh(INT32 args)   { -  if(args != 2) { -  /* FIXME: Not appropriate if too many args. */ -  SIMPLE_TOO_FEW_ARGS_ERROR("`<<", 2); -  } +  if(args != 2) +  SIMPLE_WRONG_NUM_ARGS_ERROR("`<<", 2);    o_lsh();   }   
3541:    */   PMOD_EXPORT void f_rsh(INT32 args)   { -  if(args != 2) { -  /* FIXME: Not appropriate if too many args. */ -  SIMPLE_TOO_FEW_ARGS_ERROR("`>>", 2); -  } +  if(args != 2) +  SIMPLE_WRONG_NUM_ARGS_ERROR("`>>", 2);    o_rsh();   }   
3809:   {    switch(args)    { -  case 0: SIMPLE_TOO_FEW_ARGS_ERROR("`*", 1); +  case 0: SIMPLE_WRONG_NUM_ARGS_ERROR("`*", 1);    case 1: return;    case 2: o_multiply(); return;    default:
4171:    switch(args)    {    case 0: -  case 1: SIMPLE_TOO_FEW_ARGS_ERROR("`/", 2); +  case 1: SIMPLE_WRONG_NUM_ARGS_ERROR("`/", 2);    case 2: o_divide(); break;    default:    {
4387:    */   PMOD_EXPORT void f_mod(INT32 args)   { -  if(args != 2) { -  /* FIXME: Not appropriate when too many args. */ -  SIMPLE_TOO_FEW_ARGS_ERROR("`%", 2); -  } +  if(args != 2) +  SIMPLE_WRONG_NUM_ARGS_ERROR("`%", 2);    o_mod();   }   
4465:    */   PMOD_EXPORT void f_not(INT32 args)   { -  if(args != 1) { -  /* FIXME: Not appropriate with too many args. */ -  SIMPLE_TOO_FEW_ARGS_ERROR("`!", 1); -  } +  if(args != 1) +  SIMPLE_WRONG_NUM_ARGS_ERROR("`!", 1);    o_not();   }   
4586:    */   PMOD_EXPORT void f_compl(INT32 args)   { -  if(args != 1) { -  /* FIXME: Not appropriate with too many args. */ -  SIMPLE_TOO_FEW_ARGS_ERROR("`~", 1); -  } +  if(args != 1) +  SIMPLE_WRONG_NUM_ARGS_ERROR("`~", 1);    o_compl();   }