/* the old SXEmacs general includes and utility macros moved here: */
#include "sxe-utils.h"
+#include "sxe-memory.h"
/* ------------------------ dynamic arrays ------------------- */
(CONSP (hare) ? ((elt = XCAR (hare)), 1) : \
(NILP (hare) ? 0 : \
(signal_malformed_list_error (list), 0))); \
- \
- (hare = XCDR (hare)), \
+ (hare = XCDR (hare)), SXE_SET_UNUSED(elt), \
(void)((++len > suspicion_length) && \
((void)(((len & 1) != 0)&& \
((tortoise = XCDR (tortoise)), 0)), \
Lisp_Object GELL_elt, GELL_tail; \
EXTERNAL_LIST_LOOP_4_NO_DECLARE (GELL_elt, list, GELL_tail, len) \
; \
+ (void)GELL_elt; \
} while (0)
/* For a list that's known to be in valid list format, where we may
#define PRIVATE_EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, \
hare, tortoise, suspicion_length) \
+SXE_SET_UNUSED(elt_car),SXE_SET_UNUSED(elt_cdr); \
PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, hare, tortoise, \
suspicion_length) \
if (CONSP (elt) ? (elt_car = XCAR (elt), elt_cdr = XCDR (elt), 0) :1) \
x = wrong_type_argument (Qinteger_char_or_marker_p, x); \
} while (0)
+/* basic integer definitions, used quite a lot */
+#include "ent/ent-int.h"
+
/*--------------------------- readonly objects -------------------------*/
#define CHECK_C_WRITEABLE(obj) \
/* allocation goodies */
#include "opaque.h"
-/* for size computation */
-#include "ent/ent.h"
+
+static inline EMACS_INT
+__attribute__((always_inline))
+__next_2power(EMACS_INT v)
+{
+/* compute the next 2-power of in */
+ v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+#if SIZEOF_EMACS_INT >= 4
+ v |= v >> 16;
+#endif /* sizeof(EMACS_INT) >= 4 */
+#if SIZEOF_EMACS_INT >= 8
+ v |= v >> 32;
+#endif /* sizeof(EMACS_INT) >= 8 */
+#if SIZEOF_EMACS_INT >= 16
+ v |= v >> 64;
+#endif /* sizeof(EMACS_INT) >= 16 */
+ v++;
+ return v;
+}
/* also generally useful if you want to avoid arbitrary size limits
but don't need a full dynamic array. Assumes that BASEVAR points
macro will realloc BASEVAR as necessary so that it can hold at
least NEEDED_SIZE objects. The reallocing is done by doubling,
which ensures constant amortized time per element. */
-extern_inline EMACS_INT
-__alloc_size(EMACS_INT sz, EMACS_INT needed)
- __attribute__((always_inline));
-extern_inline EMACS_INT
+static inline EMACS_INT
+__attribute__((always_inline))
__alloc_size(EMACS_INT sz, EMACS_INT needed)
{
if (UNLIKELY(needed <= 32)) {
return 32;
}
- return 1 << (1 + __ase_flsl(needed - 1));
+ return __next_2power(needed);
}
#define DO_REALLOC(basevar, sizevar, needed_size, type) \
void uncache_home_directory(void);
Extbyte *get_home_directory(void);
char *user_login_name(uid_t *);
+char *user_group_name(gid_t *);
Bufpos bufpos_clip_to_bounds(Bufpos, Bufpos, Bufpos);
Bytind bytind_clip_to_bounds(Bytind, Bytind, Bytind);
void buffer_insert1(struct buffer *, Lisp_Object);
EXFUN(Fupcase_region, 3);
EXFUN(Fuser_home_directory, 0);
EXFUN(Fuser_login_name, 1);
+EXFUN(Fuser_group_name, 1);
EXFUN(Fvector, MANY);
EXFUN(Fverify_visited_file_modtime, 1);
EXFUN(Fvertical_motion, 3);