本文整理汇总了C++中INTEGERP函数的典型用法代码示例。如果您正苦于以下问题:C++ INTEGERP函数的具体用法?C++ INTEGERP怎么用?C++ INTEGERP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INTEGERP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: record_insert
void
record_insert (ptrdiff_t beg, ptrdiff_t length)
{
Lisp_Object lbeg, lend;
if (EQ (BVAR (current_buffer, undo_list), Qt))
return;
record_point (beg);
/* If this is following another insertion and consecutive with it
in the buffer, combine the two. */
if (CONSP (BVAR (current_buffer, undo_list)))
{
Lisp_Object elt;
elt = XCAR (BVAR (current_buffer, undo_list));
if (CONSP (elt)
&& INTEGERP (XCAR (elt))
&& INTEGERP (XCDR (elt))
&& XINT (XCDR (elt)) == beg)
{
XSETCDR (elt, make_number (beg + length));
return;
}
}
XSETFASTINT (lbeg, beg);
XSETINT (lend, beg + length);
bset_undo_list (current_buffer,
Fcons (Fcons (lbeg, lend), BVAR (current_buffer, undo_list)));
}
示例2: BGl__z52getzd2mvalueszd2valz52zz__r5_control_features_6_4z00
/* _%get-mvalues-val */
obj_t BGl__z52getzd2mvalueszd2valz52zz__r5_control_features_6_4z00(obj_t
BgL_envz00_906, obj_t BgL_nz00_907)
{
AN_OBJECT;
{ /* Ieee/control5.scm 78 */
{ /* Ieee/control5.scm 79 */
int BgL_nz00_927;
{ /* Ieee/control5.scm 79 */
obj_t BgL_auxz00_952;
if (INTEGERP(BgL_nz00_907))
{ /* Ieee/control5.scm 79 */
BgL_auxz00_952 = BgL_nz00_907;
}
else
{
obj_t BgL_auxz00_955;
BgL_auxz00_955 =
BGl_typezd2errorzd2zz__errorz00
(BGl_string1520z00zz__r5_control_features_6_4z00,
BINT(((long) 3056)),
BGl_string1523z00zz__r5_control_features_6_4z00,
BGl_string1522z00zz__r5_control_features_6_4z00, BgL_nz00_907);
FAILURE(BgL_auxz00_955, BFALSE, BFALSE);
}
BgL_nz00_927 = CINT(BgL_auxz00_952);
}
return BGL_MVALUES_VAL(BgL_nz00_927);
}
}
}
示例3: parse_sound
static int
parse_sound (Lisp_Object sound, Lisp_Object *attrs)
{
/* SOUND must be a list starting with the symbol `sound'. */
if (!CONSP (sound) || !EQ (XCAR (sound), Qsound))
return 0;
sound = XCDR (sound);
attrs[SOUND_FILE] = Fplist_get (sound, QCfile);
attrs[SOUND_DATA] = Fplist_get (sound, QCdata);
attrs[SOUND_DEVICE] = Fplist_get (sound, QCdevice);
attrs[SOUND_VOLUME] = Fplist_get (sound, QCvolume);
#ifndef WINDOWSNT
/* File name or data must be specified. */
if (!STRINGP (attrs[SOUND_FILE])
&& !STRINGP (attrs[SOUND_DATA]))
return 0;
#else /* WINDOWSNT */
/*
Data is not supported in Windows. Therefore a
File name MUST be supplied.
*/
if (!STRINGP (attrs[SOUND_FILE]))
{
return 0;
}
#endif /* WINDOWSNT */
/* Volume must be in the range 0..100 or unspecified. */
if (!NILP (attrs[SOUND_VOLUME]))
{
if (INTEGERP (attrs[SOUND_VOLUME]))
{
if (XINT (attrs[SOUND_VOLUME]) < 0
|| XINT (attrs[SOUND_VOLUME]) > 100)
return 0;
}
else if (FLOATP (attrs[SOUND_VOLUME]))
{
if (XFLOAT_DATA (attrs[SOUND_VOLUME]) < 0
|| XFLOAT_DATA (attrs[SOUND_VOLUME]) > 1)
return 0;
}
else
return 0;
}
#ifndef WINDOWSNT
/* Device must be a string or unspecified. */
if (!NILP (attrs[SOUND_DEVICE])
&& !STRINGP (attrs[SOUND_DEVICE]))
return 0;
#endif /* WINDOWSNT */
/*
Since device is ignored in Windows, it does not matter
what it is.
*/
return 1;
}
示例4: whatis
char* whatis(Lisp_Object object) {
debug_print_buf[0] = '\0';
debug_print_buf[80] = '\0';
if (STRINGP(object)) {
snprintf(debug_print_buf, 80, "String %s", SSDATA(object));
return debug_print_buf;
} else if (INTEGERP(object)) {
int x = XINT(object);
snprintf(debug_print_buf, 80, "Number %d", x);
return debug_print_buf;
} else if (FLOATP(object)) {
struct Lisp_Float* floater = XFLOAT(object);
return "It's a float number!";
} else if (Qnil == object)
return "It's a lisp null";
else if (Qt == object)
return "It's a lisp 't'";
else if (SYMBOLP(object)) {
snprintf(debug_print_buf, 80, "Symbol named %s", SYMBOL_NAME(object));
return debug_print_buf;
} else if (CONSP(object))
return "It's a list!";
else if (MISCP(object))
return "It's a lisp misc!";
else if (VECTORLIKEP(object))
return "It's some kind of vector like thingie!";
else
return "I don't know what it is.";
}
示例5: INTEGERP
// concatenate two symbols, or a symbol and a string or a symbol and an integer
// the result is a symbol in the module of the first symbol
symbol *append_symbol(symbol *s1, OID s2)
{ OID i;
char *ss1 = s1->name;
ClEnv->bufferStart();
for (i = 0; ss1[i] != '\0'; i++) ClEnv->pushChar(ss1[i]);
if INTEGERP(s2) ClEnv->pushInteger(s2);
else {if (OWNER(s2) == Kernel._symbol) ss1 = OBJECT(symbol,s2)->name;
示例6: BGl__z52setzd2mvalueszd2valz12z40zz__r5_control_features_6_4z00
/* _%set-mvalues-val! */
obj_t BGl__z52setzd2mvalueszd2valz12z40zz__r5_control_features_6_4z00(obj_t
BgL_envz00_908, obj_t BgL_nz00_909, obj_t BgL_oz00_910)
{
AN_OBJECT;
{ /* Ieee/control5.scm 84 */
{ /* Ieee/control5.scm 85 */
int BgL_nz00_928;
{ /* Ieee/control5.scm 85 */
obj_t BgL_auxz00_962;
if (INTEGERP(BgL_nz00_909))
{ /* Ieee/control5.scm 85 */
BgL_auxz00_962 = BgL_nz00_909;
}
else
{
obj_t BgL_auxz00_965;
BgL_auxz00_965 =
BGl_typezd2errorzd2zz__errorz00
(BGl_string1520z00zz__r5_control_features_6_4z00,
BINT(((long) 3343)),
BGl_string1524z00zz__r5_control_features_6_4z00,
BGl_string1522z00zz__r5_control_features_6_4z00, BgL_nz00_909);
FAILURE(BgL_auxz00_965, BFALSE, BFALSE);
}
BgL_nz00_928 = CINT(BgL_auxz00_962);
}
return BGL_MVALUES_VAL_SET(BgL_nz00_928, BgL_oz00_910);
}
}
}
示例7: xftfont_add_rendering_parameters
static void
xftfont_add_rendering_parameters (FcPattern *pat, Lisp_Object entity)
{
Lisp_Object tail;
int ival;
for (tail = AREF (entity, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
{
Lisp_Object key = XCAR (XCAR (tail));
Lisp_Object val = XCDR (XCAR (tail));
if (EQ (key, QCantialias))
FcPatternAddBool (pat, FC_ANTIALIAS, NILP (val) ? FcFalse : FcTrue);
else if (EQ (key, QChinting))
FcPatternAddBool (pat, FC_HINTING, NILP (val) ? FcFalse : FcTrue);
else if (EQ (key, QCautohint))
FcPatternAddBool (pat, FC_AUTOHINT, NILP (val) ? FcFalse : FcTrue);
else if (EQ (key, QChintstyle))
{
if (INTEGERP (val))
FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
else if (SYMBOLP (val)
&& FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
}
else if (EQ (key, QCrgba))
{
if (INTEGERP (val))
FcPatternAddInteger (pat, FC_RGBA, XINT (val));
else if (SYMBOLP (val)
&& FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
FcPatternAddInteger (pat, FC_RGBA, ival);
}
else if (EQ (key, QClcdfilter))
{
if (INTEGERP (val))
FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
else if (SYMBOLP (val)
&& FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
}
#ifdef FC_EMBOLDEN
else if (EQ (key, QCembolden))
FcPatternAddBool (pat, FC_EMBOLDEN, NILP (val) ? FcFalse : FcTrue);
#endif
}
}
示例8: record_backtrace
static void
record_backtrace (log_t *log, EMACS_INT count)
{
Lisp_Object backtrace;
ptrdiff_t index;
if (!INTEGERP (log->next_free))
/* FIXME: transfer the evicted counts to a special entry rather
than dropping them on the floor. */
evict_lower_half (log);
index = XINT (log->next_free);
/* Get a "working memory" vector. */
backtrace = HASH_KEY (log, index);
get_backtrace (backtrace);
{ /* We basically do a `gethash+puthash' here, except that we have to be
careful to avoid memory allocation since we're in a signal
handler, and we optimize the code to try and avoid computing the
hash+lookup twice. See fns.c:Fputhash for reference. */
EMACS_UINT hash;
ptrdiff_t j = hash_lookup (log, backtrace, &hash);
if (j >= 0)
{
EMACS_INT old_val = XINT (HASH_VALUE (log, j));
EMACS_INT new_val = saturated_add (old_val, count);
set_hash_value_slot (log, j, make_number (new_val));
}
else
{ /* BEWARE! hash_put in general can allocate memory.
But currently it only does that if log->next_free is nil. */
int j;
eassert (!NILP (log->next_free));
j = hash_put (log, backtrace, make_number (count), hash);
/* Let's make sure we've put `backtrace' right where it
already was to start with. */
eassert (index == j);
/* FIXME: If the hash-table is almost full, we should set
some global flag so that some Elisp code can offload its
data elsewhere, so as to avoid the eviction code.
There are 2 ways to do that, AFAICT:
- Set a flag checked in QUIT, such that QUIT can then call
Fprofiler_cpu_log and stash the full log for later use.
- Set a flag check in post-gc-hook, so that Elisp code can call
profiler-cpu-log. That gives us more flexibility since that
Elisp code can then do all kinds of fun stuff like write
the log to disk. Or turn it right away into a call tree.
Of course, using Elisp is generally preferable, but it may
take longer until we get a chance to run the Elisp code, so
there's more risk that the table will get full before we
get there. */
}
}
}
示例9: module_extract_integer
static intmax_t
module_extract_integer (emacs_env *env, emacs_value n)
{
MODULE_FUNCTION_BEGIN (0);
Lisp_Object l = value_to_lisp (n);
if (! INTEGERP (l))
{
module_wrong_type (env, Qintegerp, l);
return 0;
}
return XINT (l);
}
示例10: store_function_docstring
static void
store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
{
/* Don't use indirect_function here, or defaliases will apply their
docstrings to the base functions (Bug#2603). */
Lisp_Object fun = SYMBOLP (obj) ? XSYMBOL (obj)->function : obj;
/* The type determines where the docstring is stored. */
/* Lisp_Subrs have a slot for it. */
if (SUBRP (fun))
{
intptr_t negative_offset = - offset;
XSUBR (fun)->doc = (char *) negative_offset;
}
/* If it's a lisp form, stick it in the form. */
else if (CONSP (fun))
{
Lisp_Object tem;
tem = XCAR (fun);
if (EQ (tem, Qlambda) || EQ (tem, Qautoload)
|| (EQ (tem, Qclosure) && (fun = XCDR (fun), 1)))
{
tem = Fcdr (Fcdr (fun));
if (CONSP (tem) && INTEGERP (XCAR (tem)))
/* FIXME: This modifies typically pure hash-cons'd data, so its
correctness is quite delicate. */
XSETCAR (tem, make_number (offset));
}
else if (EQ (tem, Qmacro))
store_function_docstring (XCDR (fun), offset);
}
/* Bytecode objects sometimes have slots for it. */
else if (COMPILEDP (fun))
{
/* This bytecode object must have a slot for the
docstring, since we've found a docstring for it. */
if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)
ASET (fun, COMPILED_DOC_STRING, make_number (offset));
else
{
AUTO_STRING (format, "No docstring slot for %s");
CALLN (Fmessage, format,
(SYMBOLP (obj)
? SYMBOL_NAME (obj)
: build_string ("<anonymous>")));
}
}
}
示例11: self_forward
max_value self_forward(value x)
{
struct obj *obj;
if (ATOMP(x) || INTEGERP(x) || !x)
return (max_value)x;
obj = x;
if (obj->forwarded)
return obj->size;
save_copy_and_scan(&self_layout, obj, obj->size);
}
示例12: Abs
static LispObject Abs(LispObject args)
{
CHECK_NUMBER(args);
if (FLOATP(args)) {
double r = fabs(LFLOAT(args)->value);
return MakeFloat(r);
}
if (INTEGERP(args)) {
int r = abs(LINTEGER(args));
return MakeInteger(r);
}
return Qnil;
}
示例13: BGl__processzd2sendzd2signalz00zz__processz00
/* _process-send-signal */
obj_t BGl__processzd2sendzd2signalz00zz__processz00(obj_t BgL_envz00_1484,
obj_t BgL_procz00_1485, obj_t BgL_signalz00_1486)
{
AN_OBJECT;
{ /* Llib/process.scm 177 */
{ /* Llib/process.scm 178 */
obj_t BgL_procz00_1539;
int BgL_signalz00_1540;
if (PROCESSP(BgL_procz00_1485))
{ /* Llib/process.scm 178 */
BgL_procz00_1539 = BgL_procz00_1485;
}
else
{
obj_t BgL_auxz00_1638;
BgL_auxz00_1638 =
BGl_typezd2errorzd2zz__errorz00(BGl_string2202z00zz__processz00,
BINT(((long) 7794)), BGl_string2211z00zz__processz00,
BGl_string2204z00zz__processz00, BgL_procz00_1485);
FAILURE(BgL_auxz00_1638, BFALSE, BFALSE);
}
{ /* Llib/process.scm 178 */
obj_t BgL_auxz00_1642;
if (INTEGERP(BgL_signalz00_1486))
{ /* Llib/process.scm 178 */
BgL_auxz00_1642 = BgL_signalz00_1486;
}
else
{
obj_t BgL_auxz00_1645;
BgL_auxz00_1645 =
BGl_typezd2errorzd2zz__errorz00(BGl_string2202z00zz__processz00,
BINT(((long) 7794)), BGl_string2211z00zz__processz00,
BGl_string2212z00zz__processz00, BgL_signalz00_1486);
FAILURE(BgL_auxz00_1645, BFALSE, BFALSE);
}
BgL_signalz00_1540 = CINT(BgL_auxz00_1642);
}
return c_process_send_signal(BgL_procz00_1539, BgL_signalz00_1540);
}
}
}
示例14: lookup_fringe_bitmap
int
lookup_fringe_bitmap (Lisp_Object bitmap)
{
int bn;
bitmap = Fget (bitmap, Qfringe);
if (!INTEGERP (bitmap))
return 0;
bn = XINT (bitmap);
if (bn > NO_FRINGE_BITMAP
&& bn < max_used_fringe_bitmap
&& (bn < MAX_STANDARD_FRINGE_BITMAPS
|| fringe_bitmaps[bn] != NULL))
return bn;
return 0;
}
示例15: store_function_docstring
static void
store_function_docstring (Lisp_Object obj, EMACS_INT offset)
/* Use EMACS_INT because we get offset from pointer subtraction. */
{
/* Don't use indirect_function here, or defaliases will apply their
docstrings to the base functions (Bug#2603). */
Lisp_Object fun = SYMBOLP (obj) ? XSYMBOL (obj)->function : obj;
/* The type determines where the docstring is stored. */
/* Lisp_Subrs have a slot for it. */
if (SUBRP (fun))
{
intptr_t negative_offset = - offset;
XSUBR (fun)->doc = (char *) negative_offset;
}
/* If it's a lisp form, stick it in the form. */
else if (CONSP (fun))
{
Lisp_Object tem;
tem = XCAR (fun);
if (EQ (tem, Qlambda) || EQ (tem, Qautoload)
|| (EQ (tem, Qclosure) && (fun = XCDR (fun), 1)))
{
tem = Fcdr (Fcdr (fun));
if (CONSP (tem) && INTEGERP (XCAR (tem)))
XSETCAR (tem, make_number (offset));
}
else if (EQ (tem, Qmacro))
store_function_docstring (XCDR (fun), offset);
}
/* Bytecode objects sometimes have slots for it. */
else if (COMPILEDP (fun))
{
/* This bytecode object must have a slot for the
docstring, since we've found a docstring for it. */
if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)
ASET (fun, COMPILED_DOC_STRING, make_number (offset));
}
}