您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unknown函数代码示例

51自学网 2021-06-03 09:10:36
  C++
这篇教程C++ unknown函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unknown函数的典型用法代码示例。如果您正苦于以下问题:C++ unknown函数的具体用法?C++ unknown怎么用?C++ unknown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了unknown函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: APInt

bool RangeUnitTest::runOnModule(Module & M) {	MAX_BIT_INT = InterProceduralRA<Cousot>::getMaxBitWidth(M);	Min = APInt::getSignedMinValue(MAX_BIT_INT);	Max = APInt::getSignedMaxValue(MAX_BIT_INT);	Zero = APInt(MAX_BIT_INT, 0, true);	errs() << "Running unit tests for Range class!/n";	// --------------------------- Shared Objects -------------------------//	Range unknown(Min, Max, Unknown);	Range empty(Min, Max, Empty);	Range zero(Zero, Zero);	Range infy(Min, Max);	Range pos(Zero, Max);	Range neg(Min, Zero);	Range smallNeg(NEW_APINT(-17), Zero);	Range smallPos(Zero, NEW_APINT(35));	Range avgNeg(NEW_APINT(-27817), Zero);	Range avgPos(Zero, NEW_APINT(182935));	Range bigNeg(NEW_APINT(-281239847), Zero);	Range bigPos(Zero, NEW_APINT(211821935));	// -------------------------------- ADD --------------------------------//	// [a, b] - [c, d] = [a + c, b + d]	ASSERT_TRUE("ADD1", add, infy, infy, infy);	ASSERT_TRUE("ADD2", add, zero, infy, infy);	ASSERT_TRUE("ADD3", add, zero, zero, zero);	ASSERT_TRUE("ADD4", add, neg, zero, neg);	ASSERT_TRUE("ADD5", add, neg, infy, infy);	ASSERT_TRUE("ADD6", add, neg, neg, neg);	ASSERT_TRUE("ADD7", add, pos, zero, pos);	ASSERT_TRUE("ADD8", add, pos, infy, infy);	ASSERT_TRUE("ADD9", add, pos, neg, infy);	ASSERT_TRUE("ADD10", add, pos, pos, pos);	ASSERT_TRUE("ADD11", add, smallNeg, infy, infy);	ASSERT_TRUE("ADD12", add, smallNeg, zero, smallNeg);	ASSERT_TRUE("ADD13", add, smallNeg, pos, NEW_RANGE_MAX(-17));	ASSERT_TRUE("ADD14", add, smallNeg, neg, neg);	ASSERT_TRUE("ADD15", add, smallNeg, smallNeg, NEW_RANGE_N(-34,0));	ASSERT_TRUE("ADD16", add, smallNeg, smallPos, NEW_RANGE_N(-17,35));	ASSERT_TRUE("ADD17", add, smallNeg, avgNeg, NEW_RANGE_N(-27834,0));	ASSERT_TRUE("ADD18", add, smallNeg, avgPos, NEW_RANGE_N(-17,182935));	ASSERT_TRUE("ADD19", add, smallNeg, bigNeg, NEW_RANGE_N(-281239864,0));	ASSERT_TRUE("ADD20", add, smallNeg, bigPos, NEW_RANGE_N(-17, 211821935));	ASSERT_TRUE("ADD21", add, smallPos, infy, infy);	ASSERT_TRUE("ADD22", add, smallPos, zero, smallPos);	ASSERT_TRUE("ADD23", add, smallPos, pos, pos);	ASSERT_TRUE("ADD24", add, smallPos, neg, NEW_RANGE_MIN(35));	ASSERT_TRUE("ADD25", add, smallPos, smallPos, NEW_RANGE_N(0,70));	ASSERT_TRUE("ADD26", add, smallPos, avgNeg, NEW_RANGE_N(-27817, 35));	ASSERT_TRUE("ADD27", add, smallPos, avgPos, NEW_RANGE_N(0, 182970));	ASSERT_TRUE("ADD28", add, smallPos, bigNeg, NEW_RANGE_N(-281239847, 35));	ASSERT_TRUE("ADD29", add, smallPos, bigPos, NEW_RANGE_N(0, 211821970));	ASSERT_TRUE("ADD30", add, avgNeg, infy, infy);	ASSERT_TRUE("ADD31", add, avgNeg, zero, avgNeg);	ASSERT_TRUE("ADD32", add, avgNeg, pos, NEW_RANGE_MAX(-27817));	ASSERT_TRUE("ADD33", add, avgNeg, neg, neg);	ASSERT_TRUE("ADD34", add, avgNeg, avgNeg, NEW_RANGE_N(-55634, 0));	ASSERT_TRUE("ADD35", add, avgNeg, avgPos, NEW_RANGE_N(-27817, 182935));	ASSERT_TRUE("ADD36", add, avgNeg, bigNeg, NEW_RANGE_N(-281267664, 0));	ASSERT_TRUE("ADD37", add, avgNeg, bigPos, NEW_RANGE_N(-27817, 211821935));	ASSERT_TRUE("ADD38", add, avgPos, infy, infy);	ASSERT_TRUE("ADD39", add, avgPos, zero, avgPos);	ASSERT_TRUE("ADD40", add, avgPos, pos, pos);	ASSERT_TRUE("ADD41", add, avgPos, neg, NEW_RANGE_MIN(182935));	ASSERT_TRUE("ADD42", add, avgPos, avgPos, NEW_RANGE_N(0, 365870));	ASSERT_TRUE("ADD43", add, avgPos, bigNeg, NEW_RANGE_N(-281239847, 182935));	ASSERT_TRUE("ADD44", add, avgPos, bigPos, NEW_RANGE_N(0, 212004870));	ASSERT_TRUE("ADD45", add, bigNeg, infy, infy);	ASSERT_TRUE("ADD46", add, bigNeg, zero, bigNeg);	ASSERT_TRUE("ADD47", add, bigNeg, pos, NEW_RANGE_MAX(-281239847));	ASSERT_TRUE("ADD48", add, bigNeg, neg, neg);	ASSERT_TRUE("ADD49", add, bigNeg, bigNeg, NEW_RANGE_N(-562479694, 0));	ASSERT_TRUE("ADD50", add, bigNeg, bigPos, NEW_RANGE_N(-281239847, 211821935));	ASSERT_TRUE("ADD51", add, bigPos, infy, infy);	ASSERT_TRUE("ADD52", add, bigPos, zero, bigPos);	ASSERT_TRUE("ADD53", add, bigPos, pos, pos);	ASSERT_TRUE("ADD54", add, bigPos, neg, NEW_RANGE_MIN(211821935));	ASSERT_TRUE("ADD55", add, bigPos, bigPos, NEW_RANGE_N(0,423643870));	// -------------------------------- SUB --------------------------------//	// [a, b] - [c, d] = [a - d, b - c]	ASSERT_TRUE("SUB1", sub, infy, infy, infy);	ASSERT_TRUE("SUB2", sub, infy, zero, infy);	ASSERT_TRUE("SUB3", sub, infy, pos, infy);	ASSERT_TRUE("SUB4", sub, infy, neg, infy);	ASSERT_TRUE("SUB5", sub, zero, zero, zero);	ASSERT_TRUE("SUB6", sub, zero, infy, infy);	ASSERT_TRUE("SUB7", sub, zero, pos, neg);	ASSERT_TRUE("SUB8", sub, zero, neg, pos);	ASSERT_TRUE("SUB9", sub, pos, zero, pos);	ASSERT_TRUE("SUB10", sub, pos, infy, infy);	ASSERT_TRUE("SUB11", sub, pos, neg, pos);	ASSERT_TRUE("SUB12", sub, pos, pos, infy);	ASSERT_TRUE("SUB13", sub, neg, zero, neg);	ASSERT_TRUE("SUB14", sub, neg, infy, infy);	ASSERT_TRUE("SUB15", sub, neg, neg, infy);	ASSERT_TRUE("SUB16", sub, neg, pos, neg);	// -------------------------------- MUL --------------------------------//	//  [a, b] * [c, d] = [Min(a*c, a*d, b*c, b*d), Max(a*c, a*d, b*c, b*d)]//.........这里部分代码省略.........
开发者ID:hityangzhen,项目名称:range-analysis,代码行数:101,


示例2: main

int main (int argc, char **argv) {    int fcgiSock = -1;    FCGX_Stream *paramsStream;    char *pool = NULL;    char *content, *data;    int type, count;    struct json_object  *obj, *slaveobj;    /* Set signal handling and alarm */    if (signal(SIGALRM, timeout_alarm_handler) == SIG_ERR)        critical("Setup SIGALRM trap failed!");    /* Process check arguments */    if (process_arguments(argc, argv) != OK)        unknown("Parsing arguments failed!");    /* Start plugin timeout */    alarm(mp_timeout);    /* Connect to fcgi server */    fcgiSock = mp_fcgi_connect(fcgisocket);    /* Prepare Begin Request */    FCGI_BeginRequestBody body;    body.roleB1 = 0x00;    body.roleB0 = FCGI_RESPONDER;    body.flags  = 0x000;    memset(body.reserved, 0, sizeof(body.reserved));    mp_fcgi_write(fcgiSock, 42, FCGI_BEGIN_REQUEST, (char*)&body, sizeof(body));    /* Set FCGI Params */    paramsStream = FCGX_CreateWriter(fcgiSock, 1, 8192, FCGI_PARAMS);    mp_fcgi_putkv(paramsStream, "REQUEST_METHOD", "GET");    mp_fcgi_putkv(paramsStream, "SCRIPT_NAME", query);    mp_fcgi_putkv(paramsStream, "SCRIPT_FILENAME", query);    mp_fcgi_putkv(paramsStream, "QUERY_STRING", "json&");    FCGX_FClose(paramsStream);    FCGX_FreeStream(&paramsStream);    /* Start request processing by stdin closing */    mp_fcgi_write(fcgiSock, 42, FCGI_STDIN, NULL, 0);    /* Wait for answer */    data = NULL;    do {        content = NULL;        type = mp_fcgi_read(fcgiSock, &content, &count);        if (type == FCGI_STDOUT)            data = content;        else if (content)            free(content);    } while (type != FCGI_END_REQUEST);    /* Skip http headers */    content = data;    do {        (void)strsep(&data, "/n");    } while (data && data[0] != '/r');    /* Parse JSON */    obj = mp_json_tokener_parse(data);    /* Read pool name */    mp_json_object_object_get(obj, "pool", &slaveobj);    pool = mp_strdup(json_object_get_string(slaveobj));    /* Read accepted connections */    mp_json_object_object_get(obj, "accepted conn", &slaveobj);    mp_perfdata_int("accepted_conn", json_object_get_int(slaveobj), "c", NULL);    /* Read listen queue */    mp_json_object_object_get(obj, "listen queue", &slaveobj);    mp_perfdata_int("listen_queue", json_object_get_int(slaveobj), "", NULL);    /* Read idle processes */    mp_json_object_object_get(obj, "idle processes", &slaveobj);    mp_perfdata_int("idle_processes", json_object_get_int(slaveobj), "", NULL);    /* Read active processes */    mp_json_object_object_get(obj, "active processes", &slaveobj);    mp_perfdata_int("active_processes", json_object_get_int(slaveobj), "", NULL);    free(content);    json_object_put(obj);    ok("PHP-FPM: %s", pool);}
开发者ID:MonitoringPlug,项目名称:monitoringplug,代码行数:87,


示例3: packageSizeStr

//.........这里部分代码省略.........                connect(timer, &QTimer::timeout, [=](){                    ipcSendMessage(buildMessage(QJsonObject(), "SYNC").toJson());                    timer->deleteLater();                });                timer->start();            }        }else if (messageType == "GET-CONFIG") {            tcpSendMessage(connection, buildMessage(m_configManager->currentConfig(), "CONFIG").toJson());        }else if (messageType == "READER-COMMAND") {            QJsonObject command(nodeMessage.jsonData());            /*             * When a 'reader command' message is received is because someone is sending a command to the reader. So it needs to send also who is doing this.             * To perform this it uses a field called 'sender' that carry the name of who is sending the 'command message'.             * And based on that, it will respond to the server connection or to the deskApp connection             *             * see reoutIcpMessage (messageType == "READER-RESPONSE")             */            if(connection->objectName() == "server")                command.insert("sender", QString("server"));            else                command.insert("sender", QString("app"));            ipcSendMessage(buildMessage(command, "READER-COMMAND").toJson());        }else if (messageType == "NEW-CONFIG") {            QJsonObject newConfig(nodeMessage.jsonData());            bool ackConf;            if(m_configManager->newConfig(newConfig))            {                // Send a message to stop the RFIDMonitor                emit restartMonitor();                ackConf = true;            }else{                ackConf = false;            }            QJsonObject dataObj;            dataObj.insert("success", QJsonValue(ackConf));            tcpSendMessage(connection, buildMessage(dataObj, "ACK-NEW-CONFIG").toJson());            if(m_tcpAppSocket->isOpen())                m_tcpAppSocket->close();        }else if (messageType == "DATETIME") {            QJsonObject dataObj;            dataObj["success"] =  QJsonValue(m_configManager->setDateTime(nodeMessage.dateTime()));            tcpSendMessage(connection, buildMessage(dataObj, "ACK").toJson());        }else if (messageType == "ACK-DATA") {            // A ACK-DATA message means that the server is trying to inform the RFIDMonitor that some data is now synced. So, it just send this message to the RFIDMonitor.            ipcSendMessage(data);        }else if (messageType == "GET-NET-CONFIG") {            // Only return the network configuration.            tcpSendMessage(connection, buildMessage(m_configManager->netConfig(), "NET-CONFIG").toJson());        }else if (messageType == "NEW-NET") {            QJsonObject network = nodeMessage.jsonData();            // Receive a new configuration for the network (ssid and password).            QJsonObject dataObj;            dataObj.insert("success", QJsonValue(m_configManager->setNetConfig(network)));            // returns a message ACK-NET to inform the sender that the new configuration was set            tcpSendMessage(connection, buildMessage(dataObj, "ACK-NET").toJson());            // Try to restar the network service to already use the new configuration            bool resetNet = m_configManager->restartNetwork();            qDebug() <<  QString(resetNet? "Network restarted" : "Networkt Don't restarted");        }else if (messageType == "ACK-UNKNOWN") {            QJsonDocument unknown(nodeMessage.jsonData());            QJsonObject oldMessage(unknown.object().value("unknownmessage").toObject());            qDebug() <<  "The server don't understand the message type: " << oldMessage.value("type").toString();            qDebug() <<  "ERROR message: " << unknown.object().value("errorinfo").toString();        }else if (messageType == "FULL-READ"){            ipcSendMessage(data);        }else{            /* When receives a message that can't be interpreted like any type is an unknown message.             * In this case an ACK-UNKNOWN message is built and sent to the connection that received this message             */            qDebug() <<  "UNKNOWN MESSAGE";            QJsonObject unknownObj;            unknownObj.insert("unknownmessage", QJsonValue(QJsonDocument::fromJson(data).object()));            unknownObj.insert("errorinfo", QString("Unknown message received"));            tcpSendMessage(connection, buildMessage(unknownObj, "ACK-UNKNOWN").toJson());        }        /* when all the process is done, reset the expecting message size to zero and the haspackage to false.         * Then when more data arrive it must to be the size information again.         */        packageSize = 0;        hasPackage = false;    }}
开发者ID:gustavovaliati,项目名称:rfidmonitor,代码行数:101,


示例4: test11

int test11() {  (void)(unknown() && halt3());} // expected-warning {{control may reach end of non-void function}}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例5: test13

int test13() {  (void)(halt3() && unknown());}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例6: test25

int test25() {  1 ? halt3() : unknown();}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例7: test7

int test7() {  unknown();} // expected-warning {{control reaches end of non-void function}}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例8: setEnabled

void CameraItemPropertiesTab::setCurrentItem(const CamItemInfo& itemInfo, const DMetadata& meta){    if (itemInfo.isNull())    {        d->labelFile->setAdjustedText(QString());        d->labelFolder->setAdjustedText(QString());        d->labelFileIsReadable->setAdjustedText(QString());        d->labelFileIsWritable->setAdjustedText(QString());        d->labelFileDate->setAdjustedText(QString());        d->labelFileSize->setAdjustedText(QString());        d->labelImageMime->setAdjustedText(QString());        d->labelImageDimensions->setAdjustedText(QString());        d->labelImageRatio->setAdjustedText(QString());        d->labelNewFileName->setAdjustedText(QString());        d->labelAlreadyDownloaded->setAdjustedText(QString());        d->labelPhotoMake->setAdjustedText(QString());        d->labelPhotoModel->setAdjustedText(QString());        d->labelPhotoDateTime->setAdjustedText(QString());        d->labelPhotoLens->setAdjustedText(QString());        d->labelPhotoAperture->setAdjustedText(QString());        d->labelPhotoFocalLength->setAdjustedText(QString());        d->labelPhotoExposureTime->setAdjustedText(QString());        d->labelPhotoSensitivity->setAdjustedText(QString());        d->labelPhotoExposureMode->setAdjustedText(QString());        d->labelPhotoFlash->setAdjustedText(QString());        d->labelPhotoWhiteBalance->setAdjustedText(QString());        d->labelVideoAspectRatio->setAdjustedText(QString());        d->labelVideoAudioBitRate->setAdjustedText(QString());        d->labelVideoAudioChannelType->setAdjustedText(QString());        d->labelVideoAudioCompressor->setAdjustedText(QString());        d->labelVideoDuration->setAdjustedText(QString());        d->labelVideoFrameRate->setAdjustedText(QString());        d->labelVideoVideoCodec->setAdjustedText(QString());        setEnabled(false);        return;    }    setEnabled(true);    QString str;    QString unknown(i18n("<i>unknown</i>"));    // -- Camera file system information ------------------------------------------    d->labelFile->setAdjustedText(itemInfo.name);    d->labelFolder->setAdjustedText(itemInfo.folder);    if (itemInfo.readPermissions < 0)    {        str = unknown;    }    else if (itemInfo.readPermissions == 0)    {        str = i18n("No");    }    else    {        str = i18n("Yes");    }    d->labelFileIsReadable->setAdjustedText(str);    if (itemInfo.writePermissions < 0)    {        str = unknown;    }    else if (itemInfo.writePermissions == 0)    {        str = i18n("No");    }    else    {        str = i18n("Yes");    }    d->labelFileIsWritable->setAdjustedText(str);    if (itemInfo.ctime.isValid())    {        d->labelFileDate->setAdjustedText(QLocale().toString(itemInfo.ctime, QLocale::ShortFormat));    }    else    {        d->labelFileDate->setAdjustedText(unknown);    }    str = i18n("%1 (%2)", ImagePropertiesTab::humanReadableBytesCount(itemInfo.size), QLocale().toString(itemInfo.size));    d->labelFileSize->setAdjustedText(str);    // -- Image Properties --------------------------------------------------    if (itemInfo.mime == QLatin1String("image/x-raw"))    {        d->labelImageMime->setAdjustedText(i18n("RAW Image"));    }    else    {//.........这里部分代码省略.........
开发者ID:KDE,项目名称:digikam,代码行数:101,


示例9: emu_0f

int emu_0f(unsigned char *lina){    unsigned char *orig_lina = lina;    switch (lina[1]) {    case 0x00:		/* lldt, ltr */    {	switch (REG_OPCODE(lina[2])) {	case 2:		/* 0F 00 /2 LLDT r/m16 Load segment selector r/m16 into LDTR */	{	    u_int addr, is_addr, reg, selector;	    trace("lldt/n");	    if (!opa.pe) {		set_guest_exc(EXC_UD, 0);		goto exc;	    }	    if (opa.cpl != 0) {		set_guest_exc(EXC_GP, 0);		goto exc;	    }	    lina += 2;	/* move up to RM byte */	    decode_rm16(&addr, &is_addr, &reg, &lina);	    if (emu_get(is_addr, addr, &selector, 2))		goto exc;	    if (load_ldtr(selector))		goto exc;	    break;	}	case 3: 	 /* 0F 00 /3 LTR r/m16 Load r/m16 into TR */	{	    u_int addr, is_addr, reg;	    Bit32u dtr;	    	    trace("ltr/n");	    if (!opa.pe) {		set_guest_exc(EXC_UD, 0);		goto exc;	    }	    if (opa.cpl != 0) {		set_guest_exc(EXC_GP, 0);		goto exc;	    }	    lina += 2;  /* move up to RM byte */	    decode_rm16(&addr, &is_addr, &reg, &lina);	    if (emu_get(is_addr, addr, &dtr, 2))		goto exc;	    if (load_tr(dtr))		goto exc;	    break;	}	default:	    unknown(lina);	}	break;    }        case 0x01:		/* invlpg, lgdt, lidt, lmsw */    {	int reg_op = REG_OPCODE(lina[2]);	switch (reg_op) {	case 2:				/* lgdt */	case 3:				/* lidt */	{	    u_int addr, is_addr, reg, limit, base;	    	    lina += 2;                       /* move up to RM byte */	    decode_rm(&addr, &is_addr, &reg, &lina);	    ASSERT(is_addr);	    /* addr now points to the m16&32; lina is at next instr */	    if (get_memory(opa.seg, addr, &limit, 2) != 0 ||		get_memory(opa.seg, addr+2, &base, opa.opb==4 ? 4 : 3) != 0)		goto exc;	    	    /* by definition of lgdt/lidt, base is a linear address already. */	    if (reg_op == 2) {		set_gdt(base, limit);	    } else {		set_idt(base, limit);	    }	    debug_mem("loaded %cdt from 0x%08x/n", reg_op==2 ? 'g' : 'i', base);	    break;	}	case 6:		/* 0F 01 /6  LMSW r/m16  Loads r/m16 in msw of CR0 */	{	    u_int addr, is_addr, reg, val;	    	    trace("lmsw/n");	    	    if (opa.pe && opa.cpl!=0) {		set_guest_exc(13, 0);		goto exc;	    }	    	    lina += 2;         /* move up to RM byte */	    decode_rm16(&addr, &is_addr, &reg, &lina);	    if (emu_get(is_addr, addr, &val, 2))		goto exc;//.........这里部分代码省略.........
开发者ID:aunali1,项目名称:exopc,代码行数:101,


示例10: Approximation

Approximation Approximator::find(const NullaryFunction& fun) {    if (Ob val = fun.find()) {        return Approximation(val, m_less);    }    return unknown();}
开发者ID:fritzo,项目名称:pomagma,代码行数:6,


示例11: main

int main (int argc, char **argv) {    /* Local Vars */    CURL        *curl;    char        *url;    double      size;    double      time;    /* Set signal handling and alarm */    if (signal(SIGALRM, timeout_alarm_handler) == SIG_ERR)        critical("Setup SIGALRM trap failed!");    /* Process check arguments */    if (process_arguments(argc, argv) != OK)        unknown("Parsing arguments failed!");    /* Start plugin timeout */    alarm(mp_timeout);    /* Magik */    size_t urllen = strlen(hostname)+strlen(filename) + 9;    url = mp_malloc(urllen);    snprintf(url, urllen, "tftp://%s/%s", hostname, filename);    if (mp_verbose > 0) {        printf("CURL Version: %s/n", curl_version());        printf("Try fetch %s/n", url);        print_thresholds("fetch_thresholds", fetch_thresholds);    }    /* Init libcurl */    curl = mp_curl_init();    /* Setup request */    if (curl_easy_setopt(curl, CURLOPT_PROTOCOLS, CURLPROTO_TFTP) == CURLE_UNSUPPORTED_PROTOCOL)        unknown("libcurl don't support tftp.");    curl_easy_setopt(curl, CURLOPT_URL, url);    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, mp_curl_recv_blackhole);    if (port != 0)        curl_easy_setopt(curl, CURLOPT_LOCALPORT, port);    /* Perform Request */    mp_curl_perform(curl);    /* Get metric */    curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &time);    curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD , &size);    /* Clenup libcurl */    curl_easy_cleanup(curl);    curl_global_cleanup();    mp_perfdata_float("time", (float)time, "s", fetch_thresholds);    free(url);    switch(get_status(time, fetch_thresholds)) {    case STATE_OK:        free_threshold(fetch_thresholds);        ok("Received %'.0fbyte in %fs.", size, time);        break;    case STATE_WARNING:        free_threshold(fetch_thresholds);        warning("Received %'.0fbyte in %fs.", size, time);        break;    case STATE_CRITICAL:        free_threshold(fetch_thresholds);        critical("Received %'.0fbyte in %fs.", size, time);        break;    }    free_threshold(fetch_thresholds);    critical("You should never reach this point.");}
开发者ID:khanchan,项目名称:monitoringplug,代码行数:75,


示例12: POMAGMA_ASSERT_EQ

// Inference rules, in order of appearance////                LESS x y   LESS x z//   ----------   -------------------//   LESS x TOP     LESS x RAND y z////                LESS y x   LESS z x   LESS y x   LESS z x//   ----------   -------------------   -------------------//   LESS BOT x     LESS JOIN y z x       LESS RAND y z x//bool Approximator::try_close(Approximation& approx, DenseSet& temp_set) {    POMAGMA_ASSERT_EQ(approx.lower.item_dim(), m_item_dim);    POMAGMA_ASSERT_EQ(approx.upper.item_dim(), m_item_dim);    POMAGMA_ASSERT_EQ(temp_set.item_dim(), m_item_dim);    Approximation start = unknown();    start = approx;    if (approx.ob) {        approx.upper.raw_insert(approx.ob);        approx.lower.raw_insert(approx.ob);    }    approx.upper.raw_insert(m_top);    for (auto iter = approx.upper.iter(); iter.ok(); iter.next()) {        Ob ob = *iter;        approx.upper += m_less.get_Lx_set(ob);        if (m_rand) {            temp_set.set_insn(approx.upper, m_rand->get_Lx_set(ob));            for (auto iter = temp_set.iter(); iter.ok(); iter.next()) {                Ob other = *iter;                if (other >= ob) {                    break;                }                Ob val = m_rand->find(ob, other);                approx.upper.raw_insert(val);            }        }    }    approx.lower.raw_insert(m_bot);    for (auto iter = approx.lower.iter(); iter.ok(); iter.next()) {        Ob ob = *iter;        approx.lower += m_less.get_Rx_set(ob);        if (m_join) {            temp_set.set_insn(approx.lower, m_join->get_Lx_set(ob));            for (auto iter = temp_set.iter(); iter.ok(); iter.next()) {                Ob other = *iter;                if (other >= ob) {                    break;                }                Ob val = m_join->find(ob, other);                approx.lower.raw_insert(val);            }        }        if (m_rand) {            temp_set.set_insn(approx.lower, m_rand->get_Lx_set(ob));            for (auto iter = temp_set.iter(); iter.ok(); iter.next()) {                Ob other = *iter;                if (other >= ob) {                    break;                }                Ob val = m_rand->find(ob, other);                approx.lower.raw_insert(val);            }        }    }    if (not approx.ob) {        temp_set.set_insn(approx.upper, approx.lower);        for (auto iter = temp_set.iter(); iter.ok(); iter.next()) {            approx.ob = *iter;            break;        }    }    return approx == start;}
开发者ID:fritzo,项目名称:pomagma,代码行数:81,


示例13: main

int main (int argc, char **argv) {    /* Local Vars */    char        *output = NULL;    char        *pdu_name = NULL;    int         status = STATE_OK;    long        pdu_psu1 = -1;    long        pdu_psu2 = -1;    long int    outlet_state;    char        *outlet_name;    int         i;    int         rc = 0;    mp_snmp_subtree         table_state;    netsnmp_session         *ss;    /* Set signal handling and alarm */    if (signal(SIGALRM, timeout_alarm_handler) == SIG_ERR)        critical("Setup SIGALRM trap failed!");    /* Process check arguments */    if (process_arguments(argc, argv) != OK)        unknown("Parsing arguments failed!");    /* Start plugin timeout */    alarm(mp_timeout);    ss = mp_snmp_init();    /* OIDs to query */    mp_snmp_query_cmd snmpcmd[] = {        {{1,3,6,1,4,1,318,1,1,12,4,1,1,0}, 14,            ASN_INTEGER, (void *)&pdu_psu1, sizeof(long int)},        {{1,3,6,1,4,1,318,1,1,12,4,1,2,0}, 14,            ASN_INTEGER, (void *)&pdu_psu2, sizeof(long int)},        {{1,3,6,1,2,1,1,5,0}, 9,            ASN_OCTET_STR, (void *)&pdu_name, 0},        {{0}, 0, 0, 0},    };    rc = mp_snmp_query(ss, snmpcmd);    if (rc != STAT_SUCCESS) {        char *string;        snmp_error(ss, NULL, NULL, &string);        unknown("APC PDU: Error fetching values: %s", string);    }    rc = mp_snmp_subtree_query(ss, MP_OID(1,3,6,1,4,1,318,1,1,12,3,5,1),        &table_state);    if (rc != STAT_SUCCESS) {        char *string;        snmp_error(ss, NULL, NULL, &string);        unknown("APC PDU: Error fetching table: %s", string);    }    mp_snmp_deinit();    // Check for PSU Failure    if (pdu_psu1 != 1) {        status = STATE_CRITICAL;        output = strdup("Power Supply 1 Failed!");    } else if (pdu_psu2 != 1) {        status = STATE_CRITICAL;        output = strdup("Power Supply 2 Failed!");    }    outlet_name = mp_malloc(64);    if (stateOn == NULL && stateOff == NULL) {        // Check all outlets for on.        long int outlet_state;        for (i = 0; i<table_state.size; i++) {            rc = mp_snmp_subtree_get_value(&table_state,                MP_OID(1,3,6,1,4,1,318,1,1,12,3,5,1,1,4), i,                ASN_INTEGER, (void *)&outlet_state, sizeof(long int));                        if (rc != 1)                break;            if (outlet_state != 1) {                mp_snmp_subtree_get_value(&table_state,                    MP_OID(1,3,6,1,4,1,318,1,1,12,3,5,1,1,2), i,                    ASN_OCTET_STR, (void *)&outlet_name, 64);                mp_strcat_space(&output, outlet_name);                mp_strcat_space(&output, " is off!");                status = STATE_CRITICAL;            }        }    } else {        if (stateOn != NULL) {            char *c, *s, *p;            p = s = strdup(stateOn);            while((c = strsep(&s, ","))) {                i = strtol(c, NULL, 10);                if (i == 0) {                    for (i = 0; i<table_state.size; i++) {                        rc = mp_snmp_subtree_get_value(&table_state,                            MP_OID(1,3,6,1,4,1,318,1,1,12,3,5,1,1,2), i,                            ASN_OCTET_STR, (void *)&outlet_name, 64);                        if (rc == 0 || strcmp(c, outlet_name) == 0)//.........这里部分代码省略.........
开发者ID:rjuju,项目名称:monitoringplug,代码行数:101,


示例14: main

int main (int argc, char **argv) {    /* Local Vars */    int             state = STATE_OK;    char            *ups_ident              = NULL;    long            ups_battery_status      = LONG_MIN;    long            ups_seconds_on_battery  = LONG_MIN;    long            ups_remaining_runtime   = LONG_MIN;    long            ups_remaining_charge    = LONG_MIN;    long            ups_battery_voltage     = LONG_MIN;    long            ups_battery_current     = LONG_MIN;    long            ups_battery_temperature = LONG_MIN;    long            ups_input_line_bads     = LONG_MIN;    long            ups_input_lines         = LONG_MIN;    long            ups_output_source       = LONG_MIN;    long            ups_output_frequency    = LONG_MIN;    long            ups_output_lines        = LONG_MIN;    long            ups_alarms_present      = LONG_MIN;    char            *output = NULL;    char            buf[64];    netsnmp_session *snmp_session;    mp_snmp_query_cmd snmpcmd[] = {        {{1,3,6,1,2,1,33,1,1,5,0}, 11, ASN_OCTET_STR,         (void *)&ups_ident, 0},        {{1,3,6,1,2,1,33,1,2,1,0}, 11, ASN_INTEGER,         (void *)&ups_battery_status, sizeof(long int)},        {{1,3,6,1,2,1,33,1,2,2,0}, 11, ASN_INTEGER,         (void *)&ups_seconds_on_battery, sizeof(long int)},        {{1,3,6,1,2,1,33,1,2,3,0}, 11, ASN_INTEGER,         (void *)&ups_remaining_runtime, sizeof(long int)},        {{1,3,6,1,2,1,33,1,2,4,0}, 11, ASN_INTEGER,         (void *)&ups_remaining_charge, sizeof(long int)},        {{1,3,6,1,2,1,33,1,2,5,0}, 11, ASN_INTEGER,         (void *)&ups_battery_voltage, sizeof(long int)},     /* 0.1 volts DC */        {{1,3,6,1,2,1,33,1,2,6,0}, 11, ASN_INTEGER,         (void *)&ups_battery_current, sizeof(long int)},     /* 0.1 amps DC */        {{1,3,6,1,2,1,33,1,2,7,0}, 11, ASN_INTEGER,         (void *)&ups_battery_temperature, sizeof(long int)}, /* deg C */        {{1,3,6,1,2,1,33,1,3,1,0}, 11, ASN_COUNTER,         (void *)&ups_input_line_bads, sizeof(long int)},        {{1,3,6,1,2,1,33,1,3,2,0}, 11, ASN_INTEGER,         (void *)&ups_input_lines, sizeof(long int)},        {{1,3,6,1,2,1,33,1,4,1,0}, 11, ASN_INTEGER,         (void *)&ups_output_source, sizeof(long int)},        {{1,3,6,1,2,1,33,1,4,2,0}, 11, ASN_INTEGER,         (void *)&ups_output_frequency, sizeof(long int)}, /* 0.1 RMS */        {{1,3,6,1,2,1,33,1,4,3,0}, 11, ASN_INTEGER,         (void *)&ups_output_lines, sizeof(long int)},        {{1,3,6,1,2,1,33,1,6,1,0}, 11, ASN_GAUGE,         (void *)&ups_alarms_present, sizeof(long int)},        {{0}, 0, 0, NULL},    };    /* set threshold defaults */    mp_threshold_set_warning(&threshold_charge, DEFAULT_CHARGE_WARNING, NOEXT);    mp_threshold_set_critical(&threshold_charge, DEFAULT_CHARGE_CRITICAL, NOEXT);    mp_threshold_set_warning(&threshold_runtime, DEFAULT_RUNTIME_WARNING, NOEXT);    mp_threshold_set_critical(&threshold_runtime, DEFAULT_RUNTIME_CRITICAL, NOEXT);    /* Set signal handling and alarm */    if (signal(SIGALRM, timeout_alarm_handler) == SIG_ERR)        critical("Setup SIGALRM trap failed!");    /* Process check arguments */    if (process_arguments(argc, argv) != OK)        unknown("Parsing arguments failed!");    /* Start plugin timeout */    alarm(mp_timeout);    snmp_session = mp_snmp_init();    mp_snmp_query(snmp_session, snmpcmd);    mp_snmp_deinit();    if (mp_verbose > 1) {        printf("battery status: %ld/n", ups_battery_status);        printf("output source: %ld/n", ups_output_source);        printf("alarms present: %ld/n", ups_alarms_present);        printf("input lines: %ld/n", ups_input_lines);        printf("output lines: %ld/n", ups_output_lines);        printf("input line bads: %ld/n", ups_input_line_bads);    }    if (ups_ident) {        if (*ups_ident != '/0') {            mp_snprintf((char *)&buf, sizeof(buf), "[%s] ", ups_ident);            mp_strcat(&output, buf);        }        free(ups_ident);    }    /* always warning, if on battery */    if ((ups_seconds_on_battery > 0) ||        (ups_output_source == OUTPUT_BATTERY)) {        state = STATE_WARNING;        if (ups_seconds_on_battery > 0) {            mp_snprintf((char *) &buf, sizeof(buf),                        "ON BATTERY (since %d sec%s), ",                        ups_seconds_on_battery,                        ((ups_seconds_on_battery != 1) ? "s" : ""));//.........这里部分代码省略.........
开发者ID:MonitoringPlug,项目名称:monitoringplug,代码行数:101,


示例15: while

double Teval::function(void){    char_t f[20], *p;    double v;    p = f;    while (p - f < 19 && *c >= 'a' && *c <= 'z') {        *p++ = *c;        next();    }    *p = 0;    double var;    if (getVariable(f, &var)) {        return var;    }    v = term();    if (strcmp(f, _l("abs")) == 0) {        return fabs(v);    } else if (strcmp(f, _l("fabs")) == 0) {        return fabs(v);    } else if (strcmp(f, _l("floor")) == 0) {        return floor(v);    } else if (strcmp(f, _l("ceil")) == 0) {        return ceil(v);    } else if (strcmp(f, _l("sqrt")) == 0) {        return sqrt(v);    } else if (strcmp(f, _l("exp")) == 0) {        return exp(v);    }    else if (strcmp(f, _l("sin")) == 0) {        return sin(v);    } else if (strcmp(f, _l("cos")) == 0) {        return cos(v);    } else if (strcmp(f, _l("tan")) == 0) {        return tan(v);    } else if (strcmp(f, _l("asin")) == 0) {        return asin(v);    } else if (strcmp(f, _l("acos")) == 0) {        return acos(v);    } else if (strcmp(f, _l("atan")) == 0) {        return atan(v);    }    else if (strcmp(f, _l("sinh")) == 0) {        return sinh(v);    } else if (strcmp(f, _l("cosh")) == 0) {        return cosh(v);    } else if (strcmp(f, _l("tanh")) == 0) {        return tanh(v);    }    else if (strcmp(f, _l("ln")) == 0) {        return log(v);    } else if (strcmp(f, _l("log")) == 0) {        return log(v) / M_LN2;    } else {        unknown(f);        return 0;    }}
开发者ID:roadtome,项目名称:ffdshow_tryout,代码行数:65,


示例16: LOG

void Browser::DetachEvents() {  LOG(TRACE) << "Entering Browser::DetachEvents";  CComQIPtr<IDispatch> dispatch(this->browser_);  CComPtr<IUnknown> unknown(dispatch);  HRESULT hr = this->DispEventUnadvise(unknown);}
开发者ID:AlexandraChiorean,项目名称:Selenium2,代码行数:6,


示例17: test19

int test19() {  (void)(unknown_nohalt() && unknown());} // expected-warning {{control reaches end of non-void function}}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例18: while

void PixmapItem::loadPixmap(QDomElement text ){    QDomNode node = text.firstChild();    qreal posX = 0;    qreal posY = 0;    qreal zValue = 0;    while(!node.isNull())    {        if(node.toElement().tagName() == "name")        {            name = node.toElement().text();        }        if(node.toElement().tagName() == "source")        {            source = node.toElement().text().toInt();        }        if(node.toElement().tagName() == "file")        {            file = node.toElement().text();        }        if(node.toElement().tagName() == "posX")        {            posX = node.toElement().text().toInt();        }        if(node.toElement().tagName() == "posY")        {            posY = node.toElement().text().toInt();        }        if(node.toElement().tagName() == "zValue")        {            zValue = node.toElement().text().toFloat();        }        if(node.toElement().tagName() == "width")        {            size.setWidth( node.toElement().text().toInt() );        }        if(node.toElement().tagName() == "height")        {            size.setHeight(node.toElement().text().toInt());        }        if(node.toElement().tagName() == "isLocked")        {            isLocked = node.toElement().text().toInt();            if(isLocked) {                setFlag(QGraphicsItem::ItemIsMovable, false);            }        }        node = node.nextSibling();    }    setZValue(zValue);    if(source==0)    {        QPixmap p(file);        p = p.scaledToWidth(size.width(),Qt::SmoothTransformation);        setPos(posX, posY);        setPixmap(p);    }    else    {        setPos(posX, posY);        QFile unknown(":/images/unknown.jpg");        if(unknown.open(QIODevice::ReadOnly)) {            pictureBufferUnknown.setData(unknown.readAll());            setHoruxPixmap(pictureBufferUnknown.data());        }    }}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:78,


示例19: test26

int test26() {  0 ? halt3() : unknown();} // expected-warning {{control reaches end of non-void function}}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例20: varUnusedCheck

// TODO: Implement common engine function for read and processing of sound blocks//       for use by this opcode and VIEW sound block.// TODO: Though the playSound and PlaySoundBlocking opcodes play sounds immediately,//       this opcode changes the main background sound playing..//       Current behavior here and with VIEW sound block is not right as demonstrated//       by Channelwood Card 3280 (Tank Valve) and water flow sound behavior in pipe//       on cards leading from shed...void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) {	varUnusedCheck(op, var);	int16 *soundList = NULL;	uint16 *soundListVolume = NULL;	// Used on Stoneship Card 2080	// Used on Channelwood Card 3225 with argc = 8 i.e. Conditional Sound List	if (argc == 1 || argc == 2 || argc == 8) {		debugC(kDebugScript, "Opcode %d: Process Sound Block", op);		uint16 decodeIdx = 0;		int16 soundAction = argv[decodeIdx++];		uint16 soundVolume = 65535;		if (soundAction == kMystSoundActionChangeVolume || soundAction > 0) {			soundVolume = argv[decodeIdx++];		} else if (soundAction == kMystSoundActionConditional) {			debugC(kDebugScript, "Conditional sound list");			uint16 condVar = argv[decodeIdx++];			uint16 condVarValue = getVar(condVar);			uint16 condCount = argv[decodeIdx++];			debugC(kDebugScript, "/tcondVar: %d = %d", condVar, condVarValue);			debugC(kDebugScript, "/tcondCount: %d", condCount);			soundList = new int16[condCount];			soundListVolume = new uint16[condCount];			if (condVarValue >= condCount)				warning("Opcode %d: Conditional sound variable outside range",  op);			else {				for (uint16 i = 0; i < condCount; i++) {					soundList[i] = argv[decodeIdx++];					debugC(kDebugScript, "/t/tCondition %d: Action %d", i, soundList[i]);					if (soundAction == kMystSoundActionChangeVolume || soundAction > 0) {						soundListVolume[i] = argv[decodeIdx++];					} else						soundListVolume[i] = 65535;					debugC(kDebugScript, "/t/tCondition %d: Volume %d", i, soundListVolume[i]);				}				soundAction = soundList[condVarValue];				soundVolume = soundListVolume[condVarValue];			}		}		if (soundAction == kMystSoundActionContinue)			debugC(kDebugScript, "Continue current sound");		else if (soundAction == kMystSoundActionChangeVolume) {			debugC(kDebugScript, "Continue current sound, change volume");			debugC(kDebugScript, "/tVolume: %d", soundVolume);			_vm->_sound->changeBackgroundVolumeMyst(soundVolume);		} else if (soundAction == kMystSoundActionStop) {			debugC(kDebugScript, "Stop sound");			_vm->_sound->stopBackgroundMyst();		} else if (soundAction > 0) {			debugC(kDebugScript, "Play new Sound, change volume");			debugC(kDebugScript, "/tSound: %d", soundAction);			debugC(kDebugScript, "/tVolume: %d", soundVolume);			_vm->_sound->replaceBackgroundMyst(soundAction, soundVolume);		} else {			debugC(kDebugScript, "Unknown");			warning("Unknown sound control value in opcode %d", op);		}	} else		unknown(op, var, argc, argv);	delete[] soundList;	soundList = NULL;	delete[] soundListVolume;	soundListVolume = NULL;}
开发者ID:peres,项目名称:scummvm,代码行数:79,


示例21: test9

int test9() {  (void)(halt3() + unknown());}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例22: stunHash

void stunHash(){    QString m_localUser = "XiSh";    QString m_remoteUser = "B23U";    QString m_remotePassword = "EXlVjyYgSRcC4OAxMSYDFF";    QByteArray username = QString("%1:%2").arg(m_remoteUser, m_localUser).toUtf8();    quint16 usernameSize = username.size();    username += QByteArray::fromHex("e1c318");//    username += QByteArray(4 * ((usernameSize + 3) / 4) - usernameSize, 0);    quint32 priority = 1862270975;    QByteArray unknown(8, 0);    QByteArray key = m_remotePassword.toUtf8();    QByteArray buffer;    QDataStream stream(&buffer, QIODevice::WriteOnly);    quint16 type = BindingRequest;    quint16 length = 0;    QByteArray id = QByteArray::fromHex("93be62deb6e5418f9f87b68b");    stream << type;    stream << length;    stream << MAGIC_COOKIE;    stream.writeRawData(id.data(), id.size());    stream << quint16(Priority);    stream << quint16(sizeof(priority));    stream << priority;    stream << quint16(Unknown);    stream << quint16(unknown.size());    stream.writeRawData(unknown.data(), unknown.size());    stream << quint16(Username);    stream << usernameSize;    stream.writeRawData(username.data(), username.size());    // integrity    length = buffer.size() - 20 + 24;    qint64 pos = stream.device()->pos();    stream.device()->seek(2);    stream << length;    stream.device()->seek(pos);    QByteArray integrity = QXmppUtils::generateHmacSha1(key, buffer);    qDebug() << "integrity" << integrity.toHex();    stream << quint16(MessageIntegrity);    stream << quint16(integrity.size());    stream.writeRawData(integrity.data(), integrity.size());    // fingerprint    length = buffer.size() - 20 + 8;    pos = stream.device()->pos();    stream.device()->seek(2);    stream << length;    stream.device()->seek(pos);    quint32 fingerprint = QXmppUtils::generateCrc32(buffer) ^ 0x5354554eL;    qDebug() << "fingerprint" << fingerprint;    stream << quint16(Fingerprint);    stream << quint16(sizeof(fingerprint));    stream << fingerprint;    // output    buffer.prepend(QByteArray(10, 0));    for (int i = 0; i < buffer.size(); i += 16)    {        QByteArray chunk = buffer.mid(i, 16);        QString str;        for (int j = 0; j < 16; j += 1)            str += chunk.mid(j, 1).toHex() + " ";        qDebug() << str;    }}
开发者ID:jlaine,项目名称:wilink,代码行数:74,


示例23: test12

int test12() {  (void)(halt3() || unknown());}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例24: main

int main (int argc, char **argv) {    /* Local Vars */    int             i;    int             j;    char            *filename;    bonding_info    *info;    char            *buf;    char            *output = NULL;    int             status = STATE_OK;    /* Set signal handling and alarm */    if (signal(SIGALRM, timeout_alarm_handler) == SIG_ERR)        critical("Setup SIGALRM trap failed!");    /* Process check arguments */    if (process_arguments(argc, argv) != OK)        unknown("Parsing arguments failed!");    /* Start plugin timeout */    alarm(mp_timeout);    if (bonds==0) {        DIR *dir;        struct dirent   *entry;        dir = opendir("/proc/net/bonding/");        if (dir == NULL)            critical("Can't open '/proc/net/bonding/'");        while ((entry = readdir(dir)) != NULL) {            if (strncmp(entry->d_name, "bond", 4) == 0) {                mp_array_push(&bond, strdup(entry->d_name), &bonds);            }        }        closedir(dir);    }    filename = mp_malloc(sizeof(char)*32);    buf = mp_malloc(sizeof(char)*64);    for(i=0; i < bonds; i++) {        mp_sprintf(filename, "/proc/net/bonding/%s", bond[i]);        info = parseBond(filename);        if (info == NULL) {            status = STATE_CRITICAL;            mp_snprintf(buf, 64, "%s not found", bond[i]);            mp_strcat_comma(&output, buf);        } else if (info->mii_status) {            char *up = NULL;            char *down = NULL;            for(j=0; j < info->slaves; j++) {                if (info->slave[j]->mii_status) {                    mp_strcat_comma(&up, info->slave[j]->interface);                } else {                    mp_strcat_comma(&down, info->slave[j]->interface);                }            }            if (down) {                mp_snprintf(buf, 64, "%s up (%s, down: %s)", bond[i], up, down);                status = status == STATE_OK ? STATE_WARNING : status;            } else {                mp_snprintf(buf, 64, "%s up (%s)", bond[i], up);            }            mp_strcat_comma(&output, buf);        } else {            mp_snprintf(buf, 64, "%s down (%s)", bond[i], info->mode);            mp_strcat_comma(&output, buf);            status = STATE_CRITICAL;        }    }    switch (status) {        case STATE_OK:            ok(output);            break;        case STATE_WARNING:            warning(output);            break;        case STATE_CRITICAL:            critical(output);            break;        case STATE_UNKNOWN:            unknown(output);            break;    }    critical("You should never reach this point.");}
开发者ID:rjuju,项目名称:monitoringplug,代码行数:89,


示例25: test17

int test17() {  (void)(1 && unknown());} // expected-warning {{control reaches end of non-void function}}
开发者ID:AndroidMarv,项目名称:clang,代码行数:3,


示例26: flags

static intflags(int ac, char **av){	int	i;	for (i = 1; i < ac && av[i][0] == '-'; i++) {	nxt:	switch (av[i][1]) {		case 'e':			eflag = validate(&av[i][2], 'e');			continue;		case 'E':			if (av[i][2])				eflag = validate(&av[i][2], 'E');			else if (++i < ac)				eflag = validate(av[i], 'E');			else				missing('E');			continue;		case 'i':			if (av[i][2])				iflag = validate(&av[i][2], 'i');			else				iflag = "{}";			continue;		case 'I':			if (av[i][2])				iflag = validate(&av[i][2], 'i');			else if (++i < ac)				iflag = validate(av[i], 'i');			else				missing('I');			continue;		case 'l':			if (av[i][2])				lflag = number('l', &av[i][2]);			else				lflag = 1;			xflag = 1;			iflag = NULL;			continue;		case 'L':			if (av[i][2])				lflag = number('L', &av[i][2]);			else if (++i < ac)				lflag = number('L', av[i]);			else				mustbepos('L', "");			xflag = 1;			iflag = NULL;			nflag = 0;			continue;		case 'n':			if (av[i][2])				nflag = number('n', &av[i][2]);			else if (++i < ac)				nflag = number('n', av[i]);			else				mustbepos('n', "");			lflag = 0;			continue;		case 'p':			pflag = open("/dev/tty", O_RDONLY);			fcntl(pflag, F_SETFD, FD_CLOEXEC);			tflag = 1;			break;		case 's':			if (av[i][2])				sflag = &av[i][2];			else if (++i < ac)				sflag = av[i];			else				sflag = "0";			continue;		case 't':			tflag = 1;			break;		case 'x':			xflag = 1;			break;		case '-':			return ++i;		default:			unknown(&av[i][1]);		}		if (av[i][2]) {			(av[i])++;			goto nxt;		}	}	return i;}
开发者ID:Sunshine-OS,项目名称:svr4-userland,代码行数:91,


示例27: main

int main () {    /************************        FILL 5 FIRST WHEELS    ************************/    char * tmp;    int i,j,position;    int input[5];    for(i=0;i<73;i++) {        R47[i%47] = 2;        R61[i%61] = 2;        R73[i%73] = 2;        R71[i%71] = 2;        R65[i%65] = 2;    }    for(i=0;i<1300-26;i++) {        if(ciphertext[i]==29) {            tmp = alphabet[i%26];            R47[i%47] = (tmp[0]-48)^1;            R61[i%61] = (tmp[1]-48)^1;            R73[i%73] = (tmp[2]-48)^1;            R71[i%71] = (tmp[3]-48)^1;            R65[i%65] = (tmp[4]-48)^1;        }        else if (ciphertext[i]==32) {            tmp = alphabet[i%26];            R47[i%47] = (tmp[0]-48)^0;            R61[i%61] = (tmp[1]-48)^0;            R73[i%73] = (tmp[2]-48)^0;            R71[i%71] = (tmp[3]-48)^0;            R65[i%65] = (tmp[4]-48)^0;        }    }    for(i=0;i<1300-26;i++) {        tmp = alphabet[i%26];        if(R47[i%47]==0 || R47[i%47]==1) input[0] = R47[i%47]^(tmp[0]-48); else input[0] = 2;        if(R61[i%61]==0 || R61[i%61]==1) input[1] = R61[i%61]^(tmp[1]-48); else input[1] = 2;        if(R73[i%73]==0 || R73[i%73]==1) input[2] = R73[i%73]^(tmp[2]-48); else input[2] = 2;        if(R71[i%71]==0 || R71[i%71]==1) input[3] = R71[i%71]^(tmp[3]-48); else input[3] = 2;        if(R65[i%65]==0 || R65[i%65]==1) input[4] = R65[i%65]^(tmp[4]-48); else input[4] = 2;        if(hamingsweight(input)==weightoutput(extendedalphabet[ciphertext[i]-1])) {            if(input[0]==2) R47[i%47] = 0^(tmp[0]-48);            if(input[1]==2) R61[i%61] = 0^(tmp[1]-48);            if(input[2]==2) R73[i%73] = 0^(tmp[2]-48);            if(input[3]==2) R71[i%71] = 0^(tmp[3]-48);            if(input[4]==2) R65[i%65] = 0^(tmp[4]-48);        }        else if(unknown(input)==weightoutput(extendedalphabet[ciphertext[i]-1]) && hamingsweight(input)==0) {            if(input[0]==2) R47[i%47] = 1^(tmp[0]-48);            if(input[1]==2) R61[i%61] = 1^(tmp[1]-48);            if(input[2]==2) R73[i%73] = 1^(tmp[2]-48);            if(input[3]==2) R71[i%71] = 1^(tmp[3]-48);            if(input[4]==2) R65[i%65] = 1^(tmp[4]-48);        }    }    /*for(i=0;i<1300-26;i++) {        tmp = alphabet[i%26];        printf("%d%d%d%d%d/n",(tmp[0]-48)^R47[i%47],(tmp[1]-48)^R61[i%61],(tmp[2]-48)^R73[i%73],(tmp[3]-48)^R71[i%71],(tmp[4]-48)^R65[i%65]);        printf("%s/n/n",extendedalphabet[ciphertext[i]-1]);    }*/    /***************************        PRINT 5 FIRST WHEELS    ***************************/    printf("/nWHEEL 47/n");    for(i=0;i<47;i++)        printf("%d ",R47[i]);    printf("/nWHEEL 61/n");    for(i=0;i<61;i++)        printf("%d ",R61[i]);    printf("/nWHEEL 73/n");    for(i=0;i<73;i++)        printf("%d ",R73[i]);    printf("/nWHEEL 71/n");    for(i=0;i<71;i++)        printf("%d ",R71[i]);    printf("/nWHEEL 65/n");    for(i=0;i<65;i++)        printf("%d ",R65[i]);    /**************************        FIND LAST CABLINGS    **************************/    /*for(i=0;i<73;i++) {        input[0] = (alphabet[i%26][0]-48)^R47[i%47];        input[1] = (alphabet[i%26][1]-48)^R61[i%61];        input[2] = (alphabet[i%26][2]-48)^R73[i%73];        input[3] = (alphabet[i%26][3]-48)^R71[i%71];        input[4] = (alphabet[i%26][4]-48)^R65[i%65];//.........这里部分代码省略.........
开发者ID:QuentinGouchet,项目名称:Cryptology,代码行数:101,


示例28: parse_config

/* * Parse the configuration file at `path' and execute the `action' call-back * functions for any directives defined by the array of config options (first * argument). * * For unknown directives that are encountered, you can optionally pass a * call-back function for the third argument to be called for unknowns. * * Returns zero on success; otherwise returns -1 and errno should be consulted.*/intparse_config(struct fp_config options[], const char *path,    int (*unknown)(struct fp_config *option, uint32_t line, char *directive,    char *value), uint16_t processing_options){	uint8_t bequals;	uint8_t bsemicolon;	uint8_t case_sensitive;	uint8_t comment = 0;	uint8_t end;	uint8_t found;	uint8_t have_equals = 0;	uint8_t quote;	uint8_t require_equals;	uint8_t strict_equals;	char p[2];	char *directive;	char *t;	char *value;	int error;	int fd;	ssize_t r = 1;	uint32_t dsize;	uint32_t line = 1;	uint32_t n;	uint32_t vsize;	uint32_t x;	off_t charpos;	off_t curpos;	char rpath[PATH_MAX];	/* Sanity check: if no options and no unknown function, return */	if (options == NULL && unknown == NULL)		return (-1);	/* Processing options */	bequals = (processing_options & FP_BREAK_ON_EQUALS) == 0 ? 0 : 1;	bsemicolon = (processing_options & FP_BREAK_ON_SEMICOLON) == 0 ? 0 : 1;	case_sensitive = (processing_options & FP_CASE_SENSITIVE) == 0 ? 0 : 1;	require_equals = (processing_options & FP_REQUIRE_EQUALS) == 0 ? 0 : 1;	strict_equals = (processing_options & FP_STRICT_EQUALS) == 0 ? 0 : 1;	/* Initialize strings */	directive = value = 0;	vsize = dsize = 0;	/* Resolve the file path */	if (realpath(path, rpath) == 0)		return (-1);	/* Open the file */	if ((fd = open(rpath, O_RDONLY)) < 0)		return (-1);	/* Read the file until EOF */	while (r != 0) {		r = read(fd, p, 1);		/* skip to the beginning of a directive */		while (r != 0 && (isspace(*p) || *p == '#' || comment ||		    (bsemicolon && *p == ';'))) {			if (*p == '#')				comment = 1;			else if (*p == '/n') {				comment = 0;				line++;			}			r = read(fd, p, 1);		}		/* Test for EOF; if EOF then no directive was found */		if (r == 0) {			close(fd);			return (0);		}		/* Get the current offset */		curpos = lseek(fd, 0, SEEK_CUR) - 1;		if (curpos == -1) {			close(fd);			return (-1);		}		/* Find the length of the directive */		for (n = 0; r != 0; n++) {			if (isspace(*p))				break;			if (bequals && *p == '=') {				have_equals = 1;				break;			}//.........这里部分代码省略.........
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,


示例29: messageType

/* * This function works pretty much like routTcpMessage only that this one interpretes message from RFIDMonitor and don't verify packages size. * it only tries to interpret data just arrived. */void RFIDMonitorDaemon::routeIpcMessage(){    QByteArray message = ipcConnection->readAll();    json::NodeJSMessage nodeMessage;    nodeMessage.read(QJsonDocument::fromJson(message).object());    QString messageType(nodeMessage.type());    if(messageType == "SYN"){        m_restoreTimer.stop();        ipcSendMessage(buildMessage(QJsonObject(), "ACK-SYN").toJson());        qApp->processEvents();        /* When the deskApp change some configuration the RFIDMonitor is restarted.         * But, the RFIDMonitor starts with flag connection=false. And if the server is connected the RFIDMonitor don't know that yet.         * To solve this, after 1 seconds a SYNC message is sent to RFIDMonitor to set true to connection flag.         */        if(isConnected)        {            QTimer *timer = new QTimer();            timer->setSingleShot(true);            timer->setInterval(1000);            connect(timer, &QTimer::timeout, [=](){                ipcSendMessage(buildMessage(QJsonObject(), "SYNC").toJson());                timer->deleteLater();            });            timer->start();        }        m_configManager->restartNetwork();    }else if (messageType == "READER-RESPONSE") {        QJsonObject command(nodeMessage.jsonData());        /*         * When a 'reader response' message is received is because someone sent a 'reader command' message. So it needs to know who did it.         * To perform this it uses a field called 'sender' that carry the name of who sent the 'command message'.         * And based on that, it will respond to the server connection or to the deskApp connection.         *         * see reoutTcpMessage (messageType == "READER-COMMAND")         */        if(command.value("sender").toString() == "server")            tcpSendMessage(m_tcpSocket, message);        else            tcpSendMessage(m_tcpAppSocket, message);    }else if (messageType == "DATA"){        /*         * A Data message means that the RFIDMonitor is trying to sync some data into the server. So, it just send this message to the server.         *///        qDebug() <<  "DATA Message Received from Monitor/n";//        qDebug() <<  QString(QJsonDocument(nodeMessage.jsonData()).toJson());        // Only a node.js server receives DATA messages.        tcpSendMessage(m_tcpSocket, message);    }else if (messageType == "STOPPED"){        qDebug() << "STOPPED";        m_process.kill();//        qDebug() << "Process Killed, PID: " << m_process.pid();    }    else if (messageType == "ACK-UNKNOWN") {        QJsonDocument unknown(nodeMessage.jsonData());        QJsonObject dataObj(unknown.object().value("unknownmessage").toObject());        qDebug() <<  "The Monitor don't understand the message type: "                        << dataObj.value("type").toString();    }    else{        /* When receives a message that can't be interpreted like any type is an unknown message.         * In this case an ACK-UNKNOWN message is built and sent to the connection that received this message         */        qDebug() <<  "UNKNOWN MESSAGE";        QJsonObject unknownObj;        unknownObj.insert("unknownmessage", QJsonDocument::fromJson(message).object());        unknownObj.insert("errorinfo", QString("Unknown message received"));        ipcSendMessage(buildMessage(unknownObj, "ACK-UNKNOWN").toJson());    }}
开发者ID:gustavovaliati,项目名称:rfidmonitor,代码行数:83,


示例30: main

int main(int argc, char *argv[]){	init_parse();	// Parses the commandline arguments	parse_opts(argc, argv); // IE: ./server -cserver.cfg --name "My Server"	// server config	ReadServerCfg(cfg_file ? :"server.cfg");	// init sockets	struct sockaddr_in newclient;	unsigned char buffer[MAX_BUF];	int size;	fd_set descriptor; //I don't know	sock = create_socket();	bind_socket(&sock, INADDR_ANY, sv_hostport);	// on termination	atexit(&cleanup);	signal(SIGABRT, &exit);	signal(SIGTERM, &exit);	signal(SIGINT, &exit);	// initialize rest of stuff	OnServerStart();#ifndef _WIN32	// fps control	const int inc = NS_PER_S / sv_fps;	int frame = 0;	int previous = 0;	struct timespec current, next;	clock_gettime(CLOCK_MONOTONIC, &next);#endif	// timeval for select	struct timeval timeout;	timeout.tv_sec = 0;	timeout.tv_usec = 0;	//main loop	while (1) {#ifndef _WIN32		frame++;		next.tv_nsec += inc;		while (next.tv_nsec > NS_PER_S) { //happens exactly once a second			next.tv_nsec -= NS_PER_S;			next.tv_sec++;			fpsnow = frame - previous;			previous = frame;			OnSecond();		}#endif		OnFrame();		FD_ZERO(&descriptor);		FD_SET(sock, &descriptor);		select(sock + 1, &descriptor, NULL, NULL, &timeout);		if (FD_ISSET(sock, &descriptor)){			size = udp_receive(sock, buffer, MAX_BUF, &newclient);			if (size < 3) {				perror("Invalid packet! (size < 3)/n");			} else {				stream *packet = init_stream(NULL);				Stream.write(packet, buffer+2, size-2);				// There's a chance that the guy left before all of the packet has been processed.				while(1){					int id = IsPlayerKnown(newclient.sin_addr, newclient.sin_port);					if (id){						if (ValidatePacket(buffer,id)){							PacketConfirmation(buffer,id); //If the numbering is even, send a confirmation							player[id].lastpacket = mtime();							int pid = Stream.read_byte(packet);							known_handler h = known_table[pid];							if (!h){								printf("Unhandled packet originating from %s (id:%d)/n", player[id].name, id);								//stream *lolbuf = init_stream(NULL);								//Stream.write(lolbuf, buffer, size);								//unknown(lolbuf, pid);								unknown(packet, pid);							} else								h(packet, id);						}					}else{						int pid = Stream.read_byte(packet);						unknown_handler h = unknown_table[pid];						if (!h)							unknown(packet, pid);						else							h(packet, &newclient);					}					if (EMPTY_STREAM(packet)){						free(packet);						break;//.........这里部分代码省略.........
开发者ID:FloooD,项目名称:custom_cs2dsrv,代码行数:101,



注:本文中的unknown函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ unknown_fields函数代码示例
C++ unix_time函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。