RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: lua                              Date:   24-Sep-2014 13:19:21
  Branch: rpm-5_4                          Handle: 2014092411191901

  Modified files:           (Branch: rpm-5_4)
    lua                     lcode.c ldo.c lfunc.h lstring.h lstrlib.c ltable.h
                            ltm.h lua.h lvm.c
    lua/local               lrexlib_common.h

  Log:
    - lua: LUA_GNUC_PURE suggestions.

  Summary:
    Revision    Changes     Path
    1.5.8.3     +1  -0      lua/lcode.c
    1.5.8.3     +2  -0      lua/ldo.c
    1.4.8.3     +2  -1      lua/lfunc.h
    1.2.6.2     +2  -1      lua/local/lrexlib_common.h
    1.4.8.3     +6  -3      lua/lstring.h
    1.3.6.3     +4  -0      lua/lstrlib.c
    1.4.8.3     +2  -1      lua/ltable.h
    1.4.8.3     +2  -1      lua/ltm.h
    1.3.6.4     +34 -17     lua/lua.h
    1.6.8.3     +1  -0      lua/lvm.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: lua/lcode.c
  ============================================================================
  $ cvs diff -u -r1.5.8.2 -r1.5.8.3 lcode.c
  --- lua/lcode.c       8 Sep 2014 21:18:48 -0000       1.5.8.2
  +++ lua/lcode.c       24 Sep 2014 11:19:19 -0000      1.5.8.3
  @@ -119,6 +119,7 @@
   ** check whether list has any jump that do not produce a value
   ** (or produce an inverted value)
   */
  +LUA_GNUC_PURE
   static int need_value (FuncState *fs, int list) {
     for (; list != NO_JUMP; list = getjump(fs, list)) {
       Instruction i = *getjumpcontrol(fs, list);
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/ldo.c
  ============================================================================
  $ cvs diff -u -r1.5.8.2 -r1.5.8.3 ldo.c
  --- lua/ldo.c 8 Sep 2014 21:18:49 -0000       1.5.8.2
  +++ lua/ldo.c 24 Sep 2014 11:19:19 -0000      1.5.8.3
  @@ -191,6 +191,7 @@
   }
   
   
  +LUA_GNUC_PURE
   static int stackinuse (lua_State *L) {
     CallInfo *ci;
     StkId lim = L->top;
  @@ -448,6 +449,7 @@
   /*
   ** check whether thread has a suspended protected call
   */
  +LUA_GNUC_PURE
   static CallInfo *findpcall (lua_State *L) {
     CallInfo *ci;
     for (ci = L->ci; ci != NULL; ci = ci->previous) {  /* search for a pcall */
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/lfunc.h
  ============================================================================
  $ cvs diff -u -r1.4.8.2 -r1.4.8.3 lfunc.h
  --- lua/lfunc.h       8 Sep 2014 21:18:49 -0000       1.4.8.2
  +++ lua/lfunc.h       24 Sep 2014 11:19:19 -0000      1.4.8.3
  @@ -27,7 +27,8 @@
   LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
   LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
   LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
  -                                         int pc);
  +                                         int pc)
  +                     LUA_GNUC_PURE;
   
   
   #endif
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/local/lrexlib_common.h
  ============================================================================
  $ cvs diff -u -r1.2.6.1 -r1.2.6.2 lrexlib_common.h
  --- lua/local/lrexlib_common.h        29 Jun 2013 21:03:27 -0000      1.2.6.1
  +++ lua/local/lrexlib_common.h        24 Sep 2014 11:19:20 -0000      1.2.6.2
  @@ -90,7 +90,8 @@
   int  get_int_field (lua_State *L, const char* field);
   void set_int_field (lua_State *L, const char* field, int val);
   int  get_flags (lua_State *L, const flag_pair **arr);
  -const char *get_flag_key (const flag_pair *fp, int val);
  +const char *get_flag_key (const flag_pair *fp, int val)
  +     LUA_GNUC_PURE;
   void *Lmalloc (lua_State *L, size_t size);
   
   #endif
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/lstring.h
  ============================================================================
  $ cvs diff -u -r1.4.8.2 -r1.4.8.3 lstring.h
  --- lua/lstring.h     8 Sep 2014 21:18:49 -0000       1.4.8.2
  +++ lua/lstring.h     24 Sep 2014 11:19:19 -0000      1.4.8.3
  @@ -34,9 +34,12 @@
   #define eqshrstr(a,b)        check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == 
(b))
   
   
  -LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int 
seed);
  -LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b);
  -LUAI_FUNC int luaS_eqstr (TString *a, TString *b);
  +LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int 
seed)
  +     LUA_GNUC_PURE;
  +LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b)
  +     LUA_GNUC_PURE;
  +LUAI_FUNC int luaS_eqstr (TString *a, TString *b)
  +     LUA_GNUC_PURE;
   LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
   LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
   LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/lstrlib.c
  ============================================================================
  $ cvs diff -u -r1.3.6.2 -r1.3.6.3 lstrlib.c
  --- lua/lstrlib.c     8 Sep 2014 21:18:49 -0000       1.3.6.2
  +++ lua/lstrlib.c     24 Sep 2014 11:19:19 -0000      1.3.6.3
  @@ -283,6 +283,7 @@
   }
   
   
  +LUA_GNUC_PURE
   static int matchbracketclass (int c, const char *p, const char *ec) {
     int sig = 1;
     if (*(p+1) == '^') {
  @@ -306,6 +307,7 @@
   }
   
   
  +LUA_GNUC_PURE
   static int singlematch (MatchState *ms, const char *s, const char *p,
                           const char *ep) {
     if (s >= ms->src_end)
  @@ -511,6 +513,7 @@
   
   
   
  +LUA_GNUC_PURE
   static const char *lmemfind (const char *s1, size_t l1,
                                  const char *s2, size_t l2) {
     if (l2 == 0) return s1;  /* empty strings are everywhere */
  @@ -563,6 +566,7 @@
   
   
   /* check whether pattern has no special characters */
  +LUA_GNUC_PURE
   static int nospecials (const char *p, size_t l) {
     size_t upto = 0;
     do {
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/ltable.h
  ============================================================================
  $ cvs diff -u -r1.4.8.2 -r1.4.8.3 ltable.h
  --- lua/ltable.h      8 Sep 2014 21:18:49 -0000       1.4.8.2
  +++ lua/ltable.h      24 Sep 2014 11:19:19 -0000      1.4.8.3
  @@ -24,7 +24,8 @@
   
   LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
   LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value);
  -LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
  +LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key)
  +     LUA_GNUC_PURE;
   LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
   LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key);
   LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/ltm.h
  ============================================================================
  $ cvs diff -u -r1.4.8.2 -r1.4.8.3 ltm.h
  --- lua/ltm.h 8 Sep 2014 21:18:50 -0000       1.4.8.2
  +++ lua/ltm.h 24 Sep 2014 11:19:19 -0000      1.4.8.3
  @@ -51,7 +51,8 @@
   
   LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString 
*ename);
   LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
  -                                                       TMS event);
  +                                                       TMS event)
  +                             LUA_GNUC_PURE;
   LUAI_FUNC void luaT_init (lua_State *L);
   
   #endif
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/lua.h
  ============================================================================
  $ cvs diff -u -r1.3.6.3 -r1.3.6.4 lua.h
  --- lua/lua.h 24 Sep 2014 10:57:30 -0000      1.3.6.3
  +++ lua/lua.h 24 Sep 2014 11:19:19 -0000      1.3.6.4
  @@ -135,14 +135,17 @@
   LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
   
   
  -LUA_API const lua_Number *(lua_version) (lua_State *L);
  +LUA_API const lua_Number *(lua_version) (lua_State *L)
  +     LUA_GNUC_PURE;
   
   
   /*
   ** basic stack manipulation
   */
  -LUA_API int   (lua_absindex) (lua_State *L, int idx);
  -LUA_API int   (lua_gettop) (lua_State *L);
  +LUA_API int   (lua_absindex) (lua_State *L, int idx)
  +     LUA_GNUC_PURE;
  +LUA_API int   (lua_gettop) (lua_State *L)
  +     LUA_GNUC_PURE;
   LUA_API void  (lua_settop) (lua_State *L, int idx);
   LUA_API void  (lua_pushvalue) (lua_State *L, int idx);
   LUA_API void  (lua_remove) (lua_State *L, int idx);
  @@ -159,22 +162,31 @@
   */
   
   LUA_API int             (lua_isnumber) (lua_State *L, int idx);
  -LUA_API int             (lua_isstring) (lua_State *L, int idx);
  -LUA_API int             (lua_iscfunction) (lua_State *L, int idx);
  -LUA_API int             (lua_isuserdata) (lua_State *L, int idx);
  -LUA_API int             (lua_type) (lua_State *L, int idx);
  +LUA_API int             (lua_isstring) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
  +LUA_API int             (lua_iscfunction) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
  +LUA_API int             (lua_isuserdata) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
  +LUA_API int             (lua_type) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
   LUA_API const char     *(lua_typename) (lua_State *L, int tp);
   
   LUA_API lua_Number      (lua_tonumberx) (lua_State *L, int idx, int *isnum);
   LUA_API lua_Integer     (lua_tointegerx) (lua_State *L, int idx, int *isnum);
   LUA_API lua_Unsigned    (lua_tounsignedx) (lua_State *L, int idx, int 
*isnum);
  -LUA_API int             (lua_toboolean) (lua_State *L, int idx);
  +LUA_API int             (lua_toboolean) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
   LUA_API const char     *(lua_tolstring) (lua_State *L, int idx, size_t *len);
   LUA_API size_t          (lua_rawlen) (lua_State *L, int idx);
  -LUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx);
  -LUA_API void        *(lua_touserdata) (lua_State *L, int idx);
  -LUA_API lua_State      *(lua_tothread) (lua_State *L, int idx);
  -LUA_API const void     *(lua_topointer) (lua_State *L, int idx);
  +LUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
  +LUA_API void        *(lua_touserdata) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
  +LUA_API lua_State      *(lua_tothread) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
  +LUA_API const void     *(lua_topointer) (lua_State *L, int idx)
  +                             LUA_GNUC_PURE;
   
   
   /*
  @@ -272,7 +284,8 @@
                              lua_CFunction k);
   #define lua_yield(L,n)               lua_yieldk(L, (n), 0, NULL)
   LUA_API int  (lua_resume) (lua_State *L, lua_State *from, int narg);
  -LUA_API int  (lua_status) (lua_State *L);
  +LUA_API int  (lua_status) (lua_State *L)
  +     LUA_GNUC_PURE;
   
   /*
   ** garbage-collection function and options
  @@ -387,14 +400,18 @@
   LUA_API const char *(lua_getupvalue) (lua_State *L, int funcindex, int n);
   LUA_API const char *(lua_setupvalue) (lua_State *L, int funcindex, int n);
   
  -LUA_API void *(lua_upvalueid) (lua_State *L, int fidx, int n);
  +LUA_API void *(lua_upvalueid) (lua_State *L, int fidx, int n)
  +     LUA_GNUC_PURE;
   LUA_API void  (lua_upvaluejoin) (lua_State *L, int fidx1, int n1,
                                                  int fidx2, int n2);
   
   LUA_API int (lua_sethook) (lua_State *L, lua_Hook func, int mask, int count);
  -LUA_API lua_Hook (lua_gethook) (lua_State *L);
  -LUA_API int (lua_gethookmask) (lua_State *L);
  -LUA_API int (lua_gethookcount) (lua_State *L);
  +LUA_API lua_Hook (lua_gethook) (lua_State *L)
  +     LUA_GNUC_PURE;
  +LUA_API int (lua_gethookmask) (lua_State *L)
  +     LUA_GNUC_PURE;
  +LUA_API int (lua_gethookcount) (lua_State *L)
  +     LUA_GNUC_PURE;
   
   
   struct lua_Debug {
  @@ .
  patch -p0 <<'@@ .'
  Index: lua/lvm.c
  ============================================================================
  $ cvs diff -u -r1.6.8.2 -r1.6.8.3 lvm.c
  --- lua/lvm.c 8 Sep 2014 21:18:50 -0000       1.6.8.2
  +++ lua/lvm.c 24 Sep 2014 11:19:19 -0000      1.6.8.3
  @@ -206,6 +206,7 @@
   }
   
   
  +LUA_GNUC_PURE
   static int l_strcmp (const TString *ls, const TString *rs) {
     const char *l = getstr(ls);
     size_t ll = ls->tsv.len;
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to