本文整理汇总了C++中overflow函数的典型用法代码示例。如果您正苦于以下问题:C++ overflow函数的具体用法?C++ overflow怎么用?C++ overflow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了overflow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: plus
double Ariphmetic::plus(double a, double b) {
bool positive_a = (a > 0) ? true : false;
bool positive_b = (b > 0) ? true : false;
if (!(positive_a ^ positive_b)) {
double limit = std::numeric_limits<double>::max();
double _a = (positive_a) ? a : -a;
double _b = (positive_b) ? b : -b;
if (_a > limit - _b) throw overflow();
}
return a + b;
}
开发者ID:thedilletante,项目名称:stroustrup,代码行数:11,代码来源:ariphmetic.cpp
示例2: Q_D
/*!
\overload
Displays the number \a num.
*/
void QLCDNumber::display(int num)
{
Q_D(QLCDNumber);
d->val = (double)num;
bool of;
QString s = int2string(num, d->base, d->ndigits, &of);
if (of)
emit overflow();
else
d->internalSetString(s);
}
开发者ID:Suneal,项目名称:qt,代码行数:16,代码来源:qlcdnumber.cpp
示例3: main
main(int argc, char **argv)
{
int c;
char ip[16], user[32], pass[32], rep[512];
ip[0] = 0;
user[0] = 0;
pass[0] = 0;
rep[0] = 0;
if (argc < 2) {
usage(argv[0]);
exit(0);
}
while ((c = getopt(argc, argv, "h::l:p:i:r:")) != -1) {
switch(c) {
case 'h':
usage(argv[0]);
exit(0);
case 'i':
strncpy(ip, optarg, sizeof(ip));
break;
case 'l':
strncpy(user, optarg, sizeof(user));
break;
case 'p':
strncpy(pass, optarg, sizeof(pass));
break;
case 'r':
strncpy(rep, optarg, sizeof(rep));
break;
}
}
if(ip) {
printf("Connecting to vulnerable CVS server ...");
xp_connect(ip);
printf("OK\n");
}
printf("Logging in ...");
login(user, pass, rep);
printf("OK\n");
printf("Exploiting the CVS error_prog_name double free now ...");
overflow();
printf("DONE\n");
printf("If everything went well there should be a shell on port
30464\n");
}
开发者ID:B-Rich,项目名称:osf_db,代码行数:53,代码来源:10499_0.c
示例4: customCSSText
String CSSContentDistributionValue::customCSSText() const {
CSSValueList* list = CSSValueList::createSpaceSeparated();
if (m_distribution != CSSValueInvalid)
list->append(*distribution());
if (m_position != CSSValueInvalid)
list->append(*position());
if (m_overflow != CSSValueInvalid)
list->append(*overflow());
return list->customCSSText();
}
开发者ID:mirror,项目名称:chromium,代码行数:12,代码来源:CSSContentDistributionValue.cpp
示例5: remaining
/// Equivalent to a vsprintf on the string.
int ostringstream::vformat (const char* fmt, va_list args)
{
size_t rv, space;
do {
space = remaining();
rv = vsnprintf (const_cast<char *>(ipos()), space, fmt, args);
if (ssize_t(rv) < 0)
rv = space;
} while (rv >= space && rv < overflow(rv + 1));
SetPos (pos() + minV (rv, space));
return (int)(rv);
}
开发者ID:vijaykumarm108,项目名称:lolibc,代码行数:13,代码来源:ostringstream.cpp
示例6: log_event
/*
* Write current event to the event log
* @this_fn -- function address
* @call_site -- where it was called from
* @type -- entry or exit
*/
static void __noprof log_event(void *this_fn, void *call_site, u8 type)
{
if (!overflow()) {
events[top].type = type;
events[top].time = NOW();
events[top].function = this_fn;
events[top++].call_site = call_site;
if (top == PROFBUF_MAX)
mode = PROFILER_NEEDFLUSH;
} else
mode = PROFILER_NEEDFLUSH;
}
开发者ID:virtuoso,项目名称:koowaldah,代码行数:18,代码来源:profile.c
示例7: __test_static_string_size
void __test_static_string_size()
{
my_static_string_t a("a");
my_static_string_t empty("");
my_static_string_t full("aaaaaaaaaaa");
my_static_string_t overflow("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
UF_TEST_EQUAL(a.size(), 1);
UF_TEST_EQUAL(empty.size(), 0);
UF_TEST_EQUAL(full.size(), 11);
UF_TEST_EQUAL(overflow.size(), my_static_string_t::capacity);
}
开发者ID:ceplus,项目名称:unfact,代码行数:12,代码来源:unfact_static_string_test.cpp
示例8: sync
virtual int sync()
{
// first, call overflow to clear in_buff
overflow();
if (! pptr()) return -1;
// then, call deflate asking to finish the zlib stream
zstrm_p->next_in = nullptr;
zstrm_p->avail_in = 0;
if (deflate_loop(Z_FINISH) != 0) return -1;
deflateReset(zstrm_p);
return 0;
}
开发者ID:mateidavid,项目名称:zstr,代码行数:12,代码来源:zstr.hpp
示例9: size
void Histogram<T>::print () const {
std::cout << "Total: " << size() << ", " << "Min: " << _min << ", " << "Max: " << _max << '\n';
std::cout << std::left << std::setw(6) << "-1" << '(' << std::setw(5)
<< lowest() << "-) " << std::right << std::setw(6) << underflow() << '\n';
for (unsigned i=0; i<_bins; ++i) {
std::cout << std::left << std::setw(6) << i << '(' << std::setw(5)
<< low(i) << ", " << std::setw(5) << high(i) << ")"
<< std::right << std::setw(6) << _bin[i] << '\n';
}
std::cout << std::left << std::setw(6) << _bins << '(' << std::setw(5)
<< highest() << "+) " << std::right << std::setw(6) << overflow() << '\n';
}
开发者ID:erikstrand,项目名称:estdlib,代码行数:12,代码来源:Histogram.hpp
示例10: adc
void adc(CPU *cpu, unsigned char* memory)
{
uint16_t imm = fetch_data(cpu,memory);
uint16_t temp = imm + cpu->A + cpu->P[0];
cpu->P[1] = ((temp & 0xFF) == 0) ? 1 : 0;
cpu->P[7] = (temp & 0x80) ? 1 : 0;
cpu->P[6] = overflow(cpu->A, (uint8_t)(imm), (uint8_t)(temp));
cpu->P[0] = (temp & 0x100) ? 1 : 0;
cpu->A = (uint8_t)(temp & 0x0FF);
cpu->PC += address_bytes[memory[cpu->PC]] + 1;
cpu->cycles += 2;
}
开发者ID:pjmicolet,项目名称:nesagain,代码行数:12,代码来源:cpu.c
示例11: push_level
static void
push_level(name_pointer p)
#line 340 "ctangle.w"
{
if(stack_ptr==stack_end)overflow("stack");
*stack_ptr= cur_state;
stack_ptr++;
if(p!=NULL){
cur_name= p;cur_repl= (text_pointer)p->equiv;
cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
cur_section= 0;
}
}
开发者ID:Amaterasu27,项目名称:miktex,代码行数:13,代码来源:initctangle.c
示例12: overflow
int
Mystreambuf::sync (void)
{
if (!unbuffered())
{
overflow (); // Force output
char * gp = base();
setp (gp, gp + blen() / 2);
gp = base() + blen() / 2;
setg (0, 0, 0);
}
return 0;
}
开发者ID:wisnu88,项目名称:C-Programming-Refference,代码行数:13,代码来源:mystream.cpp
示例13: customCSSText
String CSSContentDistributionValue::customCSSText() const
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
if (m_distribution != CSSValueInvalid)
list->append(distribution());
if (m_position != CSSValueInvalid)
list->append(position());
if (m_overflow != CSSValueInvalid)
list->append(overflow());
return list.release()->customCSSText();
}
开发者ID:dstockwell,项目名称:blink,代码行数:13,代码来源:CSSContentDistributionValue.cpp
示例14: P1C
void
#line 211 "./cwebdir/ctang-w2c.ch"
push_level P1C(name_pointer,p)
#line 340 "./cwebdir/ctangle.w"
{
if(stack_ptr==stack_end)overflow("stack");
*stack_ptr= cur_state;
stack_ptr++;
if(p!=NULL){
cur_name= p;cur_repl= (text_pointer)p->equiv;
cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
cur_section= 0;
}
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:14,代码来源:ctangleboot.c
示例15: iq_opt_insert_doread
void iq_opt_insert_doread(iq_t iq, seqno_t i, iq_item_t msg) {
item_t *item ;
seqno_t next ;
assert(iq_opt_insert_check(iq, i)) ;
assert (i >= iq->lo) ;
next = i + 1 ;
iq->read = next ;
iq->hi = next ;
if (i >= maxi(iq)) {
overflow(iq, i) ;
}
item = get_unsafe(iq, i) ;
do_set(item, msg) ;
}
开发者ID:dnozay,项目名称:CEnsemble,代码行数:14,代码来源:iq.c
示例16: push_nest
void
push_nest ()
{
if (nest_ptr > max_nest_stack) {
max_nest_stack = nest_ptr;
if (nest_ptr == nest_end && !realloc_nest()) {
overflow("semantic nest size", nlists);
}
}
*nest_ptr++ = cur_list;
tail = head = new_avail();
prev_graf = 0;
mode_line = line;
}
开发者ID:OS2World,项目名称:APP-WORDPROC-Common_TeX,代码行数:14,代码来源:eval.c
示例17: main
int main(){
char big_fucker[128];
int i;
//Overwrite SFP, ret, and *str
for(i = 0; i < 128; i++){
big_fucker[i] = 'A';
}
//EIP?! -- unknown
//Stack is fucked; all heap freed, though
overflow(big_fucker);
exit(0);
}
开发者ID:jakenotjacob,项目名称:learn,代码行数:14,代码来源:overflow.c
示例18: GetPresContext
/* virtual */ void
nsBCTableCellFrame::GetSelfOverflow(nsRect& aOverflowArea)
{
nsMargin halfBorder;
float p2t = GetPresContext()->PixelsToTwips();
halfBorder.top = BC_BORDER_TOP_HALF_COORD(p2t, mTopBorder);
halfBorder.right = BC_BORDER_RIGHT_HALF_COORD(p2t, mRightBorder);
halfBorder.bottom = BC_BORDER_BOTTOM_HALF_COORD(p2t, mBottomBorder);
halfBorder.left = BC_BORDER_LEFT_HALF_COORD(p2t, mLeftBorder);
nsRect overflow(nsPoint(0,0), GetSize());
overflow.Inflate(halfBorder);
aOverflowArea = overflow;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:14,代码来源:nsTableCellFrame.cpp
示例19: add
bigInt bigInt::add(bigInt b, bool &carry)
{
bigInt c;
carry = 0;
for (int i=0; i < size; i++)
{
c.a[i] = a[i] + b.a[i] + carry;
if(overflow(a[i],b.a[i],carry))
carry=1;
else
carry=0;
}
return c;
}
开发者ID:Sebastian33,项目名称:sccm,代码行数:14,代码来源:class.cpp
示例20: bt_insert
BTree* bt_insert (BTree* a, int x) {
insert(a,x);
if(overflow(a)) {
int m;
BTree* b = split(a,&m);
BTree* r = bt_create(a->ordem); r->k[0] = m;
r->p[0] = a;
r->p[1] = b;
r->n = 1;
return r;
}
return a;
}
开发者ID:sadamo,项目名称:com112_t2_btree,代码行数:14,代码来源:btree.c
注:本文中的overflow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论