Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 2019-2021 Logaev Maxim (turbocat2001), GPLv3 */
  2.  
  3. #include "tinypy.h"
  4.  
  5. #define GET_NUM_ARG() TP_TYPE(TP_NUMBER).number.val
  6. #define GET_STR_ARG() TP_TYPE(TP_STRING).string.val
  7.  
  8. static tp_obj _add(TP){
  9.     unsigned num1 = (unsigned)GET_NUM_ARG();
  10.     unsigned num2 = (unsigned)GET_NUM_ARG();
  11.     return tp_number(num1 | num2);
  12. }
  13.  
  14.