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

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

51自学网 2021-06-01 20:19:59
  C++
这篇教程C++ DEBUG_PRINTF函数代码示例写得很实用,希望能帮到您。

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

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

示例1: ShuDumpShellcode

STATUSShuDumpShellcode(	IN PVOID Address	){	LPVOID	lpStartAddress;	LPVOID	lpEndAddress;	CHAR szLogPath[MAX_PATH];	CHAR szShellcodeFile[MAX_PATH];	BYTE *ShellcodeDump;	DWORD dwRead;	DWORD dwWrite;	ERRORINFO err;	HANDLE hShellcodeFile;	STATUS status;	lpStartAddress	= Address;	lpEndAddress	= Address;	ShellcodeDump	= (BYTE *)LocalAlloc(LMEM_ZEROINIT, 2048);	/* IsBadReadPtr sucks so I have to validate memory readability by ReadProcessMemory */	while ( ReadProcessMemory( GetCurrentProcess(),                                (LPVOID)((DWORD)lpStartAddress - 4),		                       ShellcodeDump,		                       4,		                       &dwRead) 		    && ((DWORD)Address - (DWORD)lpStartAddress) < 0x200 )	{		lpStartAddress = (LPVOID)((DWORD)lpStartAddress - 4);	}	while ( ReadProcessMemory( GetCurrentProcess(),		                       (LPVOID)((DWORD)lpEndAddress + 4),			                   ShellcodeDump,			                   4,			                   &dwRead) 			&& ((DWORD)lpEndAddress - (DWORD)Address) < 0x200)	{		lpEndAddress = (LPVOID)((DWORD)lpEndAddress + 4);	}	sprintf(szShellcodeFile, "//Shellcode.bin");	strncpy( szLogPath, MCEDP_REGCONFIG.LOG_PATH, MAX_PATH);	strncat(szLogPath, szShellcodeFile, MAX_PATH);    /* Dump shellcode from memory */	ReadProcessMemory( GetCurrentProcess(),		               lpStartAddress,					   ShellcodeDump,					   ((DWORD)lpEndAddress - (DWORD)lpStartAddress),					   &dwRead);	if ( dwRead != ((DWORD)lpEndAddress - (DWORD)lpStartAddress) )	{		REPORT_ERROR("ReadProcessMemory()", &err);		LocalFree(ShellcodeDump);		return MCEDP_STATUS_INTERNAL_ERROR;	}	hShellcodeFile = CreateFile( szLogPath,		                         GENERIC_WRITE,								 0,								 NULL,								 CREATE_ALWAYS,								 FILE_ATTRIBUTE_NORMAL,								 NULL);	if ( hShellcodeFile == INVALID_HANDLE_VALUE )	{		REPORT_ERROR("CreateFile()", &err);		LocalFree(ShellcodeDump);		return MCEDP_STATUS_INTERNAL_ERROR;		}	WriteFile( hShellcodeFile, 		       ShellcodeDump,			   dwRead,			   &dwWrite,			   NULL);	if ( dwRead != dwWrite )	{		REPORT_ERROR("WriteFile()", &err);		LocalFree(ShellcodeDump);		CloseHandle(hShellcodeFile);		return MCEDP_STATUS_INTERNAL_ERROR;	}	DEBUG_PRINTF(LDBG, NULL, "Shellcode Dumped from (0x%p -- 0x%p) Size ( 0x%p )/n", lpStartAddress, lpEndAddress, ((DWORD)lpEndAddress - (DWORD)lpStartAddress));    /* log and dump disassembled version of in-memory shelloce */	status = ShuDisassembleShellcode( lpStartAddress, lpStartAddress, ((DWORD)lpEndAddress - (DWORD)lpStartAddress));	if ( status == MCEDP_STATUS_SUCCESS )		DEBUG_PRINTF(LDBG, NULL, "Shellcode disassembled successfully!/n");	else if ( status == MCEDP_STATUS_PARTIAL_DISASSEMBLE )		DEBUG_PRINTF(LDBG, NULL, "Only a part of Shellcode disassembled successfully!/n");	else		DEBUG_PRINTF(LDBG, NULL, "Faild to disassemble Shellcode!/n");	LocalFree(ShellcodeDump);//.........这里部分代码省略.........
开发者ID:amohanta,项目名称:pwnypot,代码行数:101,


示例2: freespace_openDevice

LIBFREESPACE_API int freespace_openDevice(FreespaceDeviceId id) {    int idx;    struct FreespaceDeviceStruct* device = freespace_private_getDeviceById(id);    if (device == NULL) {        return FREESPACE_ERROR_NO_DEVICE;    }    if (device->isOpened_) {        // Each device can only be opened once.        return FREESPACE_ERROR_BUSY;    }    for (idx = 0; idx < device->handleCount_; idx++) {        struct FreespaceSubStruct* s = &device->handle_[idx];        if (s->handle_ != NULL) {            // Device was partially (incorrectly) opened.            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_BUSY;        }        if (s->devicePath == NULL) {            // Device was not fully enumerated.            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_NO_DEVICE;        }        DEBUG_WPRINTF(L"Open %s/n", s->devicePath);        s->handle_ = CreateFile(s->devicePath,                                GENERIC_READ | GENERIC_WRITE,                                FILE_SHARE_READ | FILE_SHARE_WRITE,                                NULL,                                OPEN_EXISTING,                                FILE_FLAG_OVERLAPPED,                                NULL);        {            DWORD d;            if (!GetHandleInformation(s->handle_, &d)) {                // We do not have the correct handle.                DEBUG_PRINTF("freespace_openDevice failed with code %d/n", GetLastError());            }        }        if (s->handle_ == INVALID_HANDLE_VALUE) {            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_NO_DEVICE;        }        if (!BindIoCompletionCallback(s->handle_, freespace_private_overlappedCallback, 0)) {            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_UNEXPECTED;        }        if (!HidD_SetNumInputBuffers(s->handle_, HID_NUM_INPUT_BUFFERS)) {            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_NO_DEVICE;        }        // Create the read event.        s->readOverlapped_.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);        if (s->readOverlapped_.hEvent == NULL) {            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_UNEXPECTED;        }        s->readOverlapped_.Offset = 0;        s->readOverlapped_.OffsetHigh = 0;        s->readStatus_ = FALSE;    }    device->isOpened_ = TRUE;    // Enable send by initializing all send events.    for (idx = 0; idx < FREESPACE_MAXIMUM_SEND_MESSAGE_COUNT; idx++) {        device->send_[idx].overlapped_.hEvent = NULL;        if (initializeSendStruct(&device->send_[idx]) != FREESPACE_SUCCESS) {            freespace_private_forceCloseDevice(device);            return FREESPACE_ERROR_UNEXPECTED;        }    }    // If async mode has been enabled already, then start the receive    // process going.    if (freespace_instance_->fdAddedCallback_) {        int rc;        rc = initiateAsyncReceives(device);        if (rc != FREESPACE_SUCCESS) {            freespace_private_forceCloseDevice(device);            return rc;        }    }    return FREESPACE_SUCCESS;}
开发者ID:cobbchaseRazer,项目名称:libfreespace,代码行数:91,


示例3: freespace_private_read

int freespace_private_read(FreespaceDeviceId id,                           uint8_t* message,                           int maxLength,                           unsigned int timeoutMs,                           int* actualLength) {    HANDLE waitEvents[FREESPACE_HANDLE_COUNT_MAX];    int idx;    DWORD bResult;    struct FreespaceDeviceStruct* device = freespace_private_getDeviceById(id);    if (device == NULL) {        return FREESPACE_ERROR_NO_DEVICE;    }    // Start the reads going.    for (idx = 0; idx < device->handleCount_; idx++) {        BOOL bResult;        struct FreespaceSubStruct* s = &device->handle_[idx];        waitEvents[idx] = s->readOverlapped_.hEvent;        // Initiate a ReadFile on anything that doesn't already have        // a ReadFile op pending.        if (!s->readStatus_) {            int lastErr;            bResult = ReadFile(                               s->handle_,                 /* handle to device */                               s->readBuffer,              /* IN report buffer to fill */                               s->info_.inputReportByteLength_,  /* input buffer size */                               &s->readBufferSize,         /* returned buffer size */                               &s->readOverlapped_ );      /* long pointer to an OVERLAPPED structure */            lastErr = GetLastError();            if (bResult) {                // Got something immediately, so return it.                *actualLength = min(s->readBufferSize, (unsigned long) maxLength);                memcpy(message, s->readBuffer, *actualLength);                return FREESPACE_SUCCESS;            } else if (lastErr != ERROR_IO_PENDING) {                // Something severe happened to our device!                DEBUG_PRINTF("freespace_read 1: Error on %d : %d/n", idx, lastErr);                return handleDeviceFailure(device, lastErr);            }            s->readStatus_ = TRUE;        }    }    // Wait.    bResult = WaitForMultipleObjects(device->handleCount_, waitEvents, FALSE, timeoutMs);    if (bResult == WAIT_FAILED) {        DEBUG_PRINTF("Error from WaitForMultipleObjects/n");        return FREESPACE_ERROR_IO;    } else if (bResult == WAIT_TIMEOUT) {        return FREESPACE_ERROR_TIMEOUT;    }    // Check which read worked.    for (idx = 0; idx < device->handleCount_; idx++) {        int lastErr;        struct FreespaceSubStruct* s = &device->handle_[idx];        BOOL bResult = GetOverlappedResult(                                           s->handle_,                 /* handle to device */                                           &s->readOverlapped_,        /* long pointer to an OVERLAPPED structure */                                           &s->readBufferSize,         /* returned buffer size */                                           FALSE);        lastErr = GetLastError();        if (bResult) {            // Got something, so report it.            *actualLength = min(s->readBufferSize, (unsigned long) maxLength);            memcpy(message, s->readBuffer, *actualLength);            s->readStatus_ = FALSE;            return FREESPACE_SUCCESS;        } else if (lastErr != ERROR_IO_INCOMPLETE) {            // Something severe happened to our device!            DEBUG_PRINTF("freespace_read 2 : Error on %d : %d/n", idx, lastErr);            return handleDeviceFailure(device, lastErr);        }    }    return FREESPACE_ERROR_IO;}
开发者ID:cobbchaseRazer,项目名称:libfreespace,代码行数:80,


示例4: user_task

//.........这里部分代码省略.........	if(dscale_inc < 0.0)	{		red = 255;		blue = 0;		green = 0;	}	else	{		red = 0;		blue = 255;		green = 0;	}	// RGB - YELLOW    tft_drawCircle(windemo, windemo->w/2, windemo->h/2, dscale, tft_color565(red,green,blue));#endif    degree += deg_inc;    dscale += dscale_inc;	if(degree <= -360)		deg_inc = 4;	if(degree >= 360)		deg_inc = -4;    if(dscale < dscale_max/2)	{	   dscale_inc = -dscale_inc;	}    if(dscale > dscale_max)	{	   dscale_inc = -dscale_inc;	}#ifdef WIRECUBE	V.x = degree;	V.y = degree;	V.z = degree;	//time1 = system_get_time();	wire_draw(windemo, cube_points, cube_edges, &V, windemo->w/2, windemo->h/2, dscale, ILI9341_WHITE);	//wire_draw(windemo, cube_points, cube_edges, &V, windemo->w/2, windemo->h/2, dscale, ILI9341_WHITE);	//time2 = system_get_time();#endif// Get system voltage 33 = 3.3 volts	adc_sum += system_adc_read();	//adc_sum += system_get_vdd33();	// FIXME atomic access	if(++adc_count == 10)	{		voltage = ((double) adc_sum / 100.0); 		adc_count = 0;		adc_sum = 0;	}	// DEBUG_PRINTF("Degree: %d /r/n",(int)degree);	// cube redraw count	count += 1;	tft_set_font(winstats,0);	tft_setpos(winstats,ip_xpos,ip_ypos);	tft_printf(winstats,"%-26s/n", ip_msg);	if(!signal_loop--)	{		signal_loop = 100;		tft_printf(winstats,"CH:%02d, DB:-%02d/n", 			wifi_get_channel(),			wifi_station_get_rssi());		signal_loop = 0;	}	tft_setpos(winstats,xpos,ypos);	tft_printf(winstats,"Heap: %d/n", system_get_free_heap_size());	tft_printf(winstats,"Iter:% 9ld, %+7.2f/n", count, degree);		// NTP state machine	ntp_setup();	// get current time	time(&sec);	tft_printf(winstats,"Volt:%2.2f/n%s/n", (float)voltage, ctime(&sec));	#ifdef NETWORK_TEST	poll_network_message(wintest);#endif// Buffered get line uses interrupts and queues	if(uart0_gets(buffer,255))	{		DEBUG_PRINTF("Command:%s/n",buffer);		if(!fatfs_tests(buffer))		{			if(!user_tests(buffer))			{				DEBUG_PRINTF("unknow command: %s/n", buffer);			}		}	}}
开发者ID:sergey-kaydalov,项目名称:esp8266_ili9341-1,代码行数:101,


示例5: initiateAsyncReceives

static int initiateAsyncReceives(struct FreespaceDeviceStruct* device) {    int idx;    int funcRc = FREESPACE_SUCCESS;    int rc;	struct freespace_message m;    // If no callback or not opened, then don't need to request to receive anything.    if (!device->isOpened_ || (device->receiveCallback_ == NULL && device->receiveMessageCallback_ == NULL)) {        return FREESPACE_SUCCESS;    }    // Initialize a new read operation on all handles that need it.    for (idx = 0; idx < device->handleCount_; idx++) {        struct FreespaceSubStruct* s = &device->handle_[idx];        if (!s->readStatus_) {            for (;;) {                BOOL bResult = ReadFile(					s->handle_,                 /* handle to device */					s->readBuffer,              /* IN report buffer to fill */					s->info_.inputReportByteLength_,  /* input buffer size */					&s->readBufferSize,         /* returned buffer size */					&s->readOverlapped_ );      /* long pointer to an OVERLAPPED structure */                if (bResult) {                    // Got something, so report it.					if (device->receiveCallback_ || device->receiveMessageCallback_) {						if (device->receiveCallback_) {							device->receiveCallback_(device->id_, (char *) (s->readBuffer), s->readBufferSize, device->receiveCookie_, FREESPACE_SUCCESS);						}						if (device->receiveMessageCallback_) {							rc = freespace_decode_message((char *) (s->readBuffer), s->readBufferSize, &m, device->hVer_);							if (rc == FREESPACE_SUCCESS) {								device->receiveMessageCallback_(device->id_, &m, device->receiveMessageCookie_, FREESPACE_SUCCESS);							} else {								device->receiveMessageCallback_(device->id_, NULL, device->receiveMessageCookie_, rc);								DEBUG_PRINTF("freespace_decode_message failed with code %d/n", rc);							}						}					} else {                        // If no receiveCallback, then freespace_setReceiveCallback was called to stop                        // receives from within the receiveCallback. Bail out to let it do its thing.                        return FREESPACE_SUCCESS;                    }                } else {                    // Error or would block - check below.                    break;                }            }            rc = GetLastError();            if (rc == ERROR_IO_PENDING) {                // We got a ReadFile to block, so mark it.                s->readStatus_ = TRUE;            } else {                // Something severe happened to our device!				if (device->receiveCallback_) {				    device->receiveCallback_(device->id_, NULL, 0, device->receiveCookie_, rc);				}				if (device->receiveMessageCallback_) {				    device->receiveMessageCallback_(device->id_, NULL, device->receiveMessageCookie_, rc);				}                DEBUG_PRINTF("initiateAsyncReceives : Error on %d : %d/n", idx, rc);                return handleDeviceFailure(device, rc);            }        }    }    return funcRc;}
开发者ID:cobbchaseRazer,项目名称:libfreespace,代码行数:68,


示例6: statement

/*---------------------------------------------------------------------------*/static uint8_t statement(void){  int token;  string_temp_free();  token = current_token;  /* LET may be omitted.. */  if (token != TOKENIZER_INTVAR && token != TOKENIZER_STRINGVAR)    accept_tok(token);  switch(token) {  case TOKENIZER_QUESTION:  case TOKENIZER_PRINT:    print_statement();    break;  case TOKENIZER_IF:    if_statement();    break;  case TOKENIZER_GO:    go_statement();    return 0;  case TOKENIZER_RETURN:    return_statement();    break;  case TOKENIZER_FOR:    for_statement();    break;  case TOKENIZER_POKE:    poke_statement();    break;  case TOKENIZER_NEXT:    next_statement();    break;  case TOKENIZER_STOP:    stop_statement();    break;  case TOKENIZER_REM:    rem_statement();    break;  case TOKENIZER_DATA:    data_statement();    break;  case TOKENIZER_RANDOMIZE:    randomize_statement();    break;  case TOKENIZER_OPTION:    option_statement();    break;  case TOKENIZER_INPUT:    input_statement();    break;  case TOKENIZER_RESTORE:    restore_statement();    break;  case TOKENIZER_DIM:    dim_statement();    break;  case TOKENIZER_CLS:    cls_statement();    break;  case TOKENIZER_LET:  case TOKENIZER_STRINGVAR:  case TOKENIZER_INTVAR:    let_statement();    break;  default:    DEBUG_PRINTF("ubasic.c: statement(): not implemented %d/n", token);    syntax_error();  }  return 1;}
开发者ID:EtchedPixels,项目名称:ubasic,代码行数:73,


示例7: relation

/*---------------------------------------------------------------------------*/static void relation(struct typevalue *r1){  struct typevalue r2;  int op;  mathexpr(r1);  op = current_token;  DEBUG_PRINTF("relation: token %d/n", op);  /* FIXME: unclear the while is correct here. It's not correct in most     BASIC to write  A > B > C, rather relations should be two part linked     with logic */  while(op == TOKENIZER_LT ||       op == TOKENIZER_GT ||       op == TOKENIZER_EQ ||       op == TOKENIZER_NE ||       op == TOKENIZER_LE ||       op == TOKENIZER_GE) {    tokenizer_next();    mathexpr(&r2);    typecheck_same(r1, &r2);    DEBUG_PRINTF("relation: %d %d %d/n", r1->d.i, op, r2.d.i);    if (r1->type == TYPE_INTEGER) {      switch(op) {      case TOKENIZER_LT:        r1->d.i = r1->d.i < r2.d.i;        break;      case TOKENIZER_GT:        r1->d.i = r1->d.i > r2.d.i;        break;      case TOKENIZER_EQ:        r1->d.i = r1->d.i == r2.d.i;        break;      case TOKENIZER_LE:        r1->d.i = r1->d.i <= r2.d.i;        break;      case TOKENIZER_GE:        r1->d.i = r1->d.i >= r2.d.i;        break;      case TOKENIZER_NE:        r1->d.i = r1->d.i != r2.d.i;        break;      }    } else {      int n =*r1->d.p;      if (*r2.d.p < n)        n = *r2.d.p;      n = memcmp(r1->d.p + 1, r2.d.p + 1, n);      if (n == 0) {        if (*r1->d.p > *r2.d.p)          n = 1;        else if (*r1->d.p < *r2.d.p)          n = -1;      }      switch(op) {        case TOKENIZER_LT:          n = (n == -1);          break;        case TOKENIZER_GT:          n = (n == 1);          break;        case TOKENIZER_EQ:          n = (n == 0);          break;        case TOKENIZER_LE:          n = (n != 1);          break;        case TOKENIZER_GE:          n = (n != -1);          break;        case TOKENIZER_NE:          n = (n != 0);          break;      }      r1->d.i = n;    }    op = current_token;  }  r1->type = TYPE_INTEGER;}
开发者ID:EtchedPixels,项目名称:ubasic,代码行数:80,


示例8: findSquashers

map<NFAVertex, NFAStateSet> findSquashers(const NGHolder &g, som_type som) {    map<NFAVertex, NFAStateSet> squash;    // Number of bits to use for all our masks. If we're a triggered graph,    // tops have already been assigned, so we don't have to account for them.    const u32 numStates = num_vertices(g);    // Build post-dominator tree.    PostDomTree pdom_tree;    buildPDomTree(g, pdom_tree);    // Build list of vertices by state ID and a set of init states.    vector<NFAVertex> vByIndex(numStates, NFAGraph::null_vertex());    NFAStateSet initStates(numStates);    smgb_cache cache(g);    // Mappings used for SOM mode calculations, otherwise left empty.    unordered_map<NFAVertex, u32> region_map;    vector<DepthMinMax> som_depths;    if (som) {        region_map = assignRegions(g);        som_depths = getDistancesFromSOM(g);    }    for (auto v : vertices_range(g)) {        const u32 vert_id = g[v].index;        DEBUG_PRINTF("vertex %u/%u/n", vert_id, numStates);        assert(vert_id < numStates);        vByIndex[vert_id] = v;        if (is_any_start(v, g) || !in_degree(v, g)) {            initStates.set(vert_id);        }    }    for (u32 i = 0; i < numStates; i++) {        NFAVertex v = vByIndex[i];        assert(v != NFAGraph::null_vertex());        const CharReach &cr = g[v].char_reach;        /* only non-init cyclics can be squashers */        if (!hasSelfLoop(v, g) || initStates.test(i)) {            continue;        }        DEBUG_PRINTF("state %u is cyclic/n", i);        NFAStateSet mask(numStates), succ(numStates), pred(numStates);        buildSquashMask(mask, g, v, cr, initStates, vByIndex, pdom_tree, som,                        som_depths, region_map, cache);        buildSucc(succ, g, v);        buildPred(pred, g, v);        const auto &reports = g[v].reports;        for (size_t j = succ.find_first(); j != succ.npos;             j = succ.find_next(j)) {            NFAVertex vj = vByIndex[j];            NFAStateSet pred2(numStates);            buildPred(pred2, g, vj);            if (pred2 == pred) {                DEBUG_PRINTF("adding the sm from %zu to %u's sm/n", j, i);                NFAStateSet tmp(numStates);                buildSquashMask(tmp, g, vj, cr, initStates, vByIndex, pdom_tree,                                som, som_depths, region_map, cache);                mask &= tmp;            }        }        for (size_t j = pred.find_first(); j != pred.npos;             j = pred.find_next(j)) {            NFAVertex vj = vByIndex[j];            NFAStateSet succ2(numStates);            buildSucc(succ2, g, vj);            /* we can use j as a basis for squashing if its succs are a subset             * of ours */            if ((succ2 & ~succ).any()) {                continue;            }            if (som) {                /* We cannot use j to add to the squash mask of v if it may                 * have an earlier start of match offset. ie for us j as a                 * basis for the squash mask of v we require:                 * maxSomDist(j) <= minSomDist(v)                 */                /* ** TODO ** */                const depth &max_som_dist_j =                    som_depths[g[vj].index].max;                const depth &min_som_dist_v =                    som_depths[g[v].index].min;                if (max_som_dist_j > min_som_dist_v ||                    max_som_dist_j.is_infinite()) {                    /* j can't be used as it may be storing an earlier SOM */                    continue;                }            }            const CharReach &crv = g[vj].char_reach;//.........这里部分代码省略.........
开发者ID:0x4e38,项目名称:hyperscan,代码行数:101,


示例9: rtems_ftpfs_open_ctrl_connection

static int rtems_ftpfs_open_ctrl_connection(  rtems_ftpfs_entry *e,  const char *user,  const char *password,  const char *hostname,  uint32_t *client_address,  bool verbose,  const struct timeval *timeout){  int rv = 0;  int eno = 0;  rtems_ftpfs_reply reply = RTEMS_FTPFS_REPLY_ERROR;  struct in_addr address = { .s_addr = 0 };  struct sockaddr_in sa;  socklen_t size = 0;  /* Create the socket for the control connection */  e->ctrl_socket = socket(AF_INET, SOCK_STREAM, 0);  if (e->ctrl_socket < 0) {    return ENOMEM;  }  /* Set up the server address from the hostname */  if (inet_aton(hostname, &address) == 0) {    /* Try to get the address by name */    struct hostent *he = gethostbyname(hostname);    if (he != NULL) {      memcpy(&address, he->h_addr, sizeof(address));    } else {      return ENOENT;    }  }  rtems_ftpfs_create_address(&sa, address.s_addr, htons(RTEMS_FTPFS_CTRL_PORT));  DEBUG_PRINTF("server = %s/n", inet_ntoa(sa.sin_addr));  /* Open control connection */  rv = connect(    e->ctrl_socket,    (struct sockaddr *) &sa,    sizeof(sa)  );  if (rv != 0) {    return ENOENT;  }  /* Set control connection timeout */  eno = rtems_ftpfs_set_connection_timeout(e->ctrl_socket, timeout);  if (eno != 0) {    return eno;  }  /* Get client address */  size = rtems_ftpfs_create_address(&sa, INADDR_ANY, 0);  rv = getsockname(    e->ctrl_socket,    (struct sockaddr *) &sa,    &size  );  if (rv != 0) {    return ENOMEM;  }  *client_address = ntohl(sa.sin_addr.s_addr);  DEBUG_PRINTF("client = %s/n", inet_ntoa(sa.sin_addr));  /* Now we should get a welcome message from the server */  reply = rtems_ftpfs_get_reply(e, NULL, NULL, verbose);  if (reply != RTEMS_FTPFS_REPLY_2) {    return ENOENT;  }  /* Send USER command */  reply = rtems_ftpfs_send_command(e, "USER ", user, verbose);  if (reply == RTEMS_FTPFS_REPLY_3) {    /* Send PASS command */    reply = rtems_ftpfs_send_command(e, "PASS ", password, verbose);    if (reply != RTEMS_FTPFS_REPLY_2) {      return EACCES;    }    /* TODO: Some server may require an account */  } else if (reply != RTEMS_FTPFS_REPLY_2) {    return EACCES;  }  /* Send TYPE command to set binary mode for all data transfers */  reply = rtems_ftpfs_send_command(e, "TYPE I", NULL, verbose);  if (reply != RTEMS_FTPFS_REPLY_2) {    return EIO;  }  return 0;}static int rtems_ftpfs_open_data_connection_active(  rtems_ftpfs_entry *e,  uint32_t client_address,  const char *file_command,  const char *filename,//.........这里部分代码省略.........
开发者ID:aniwang2013,项目名称:leon-rtems,代码行数:101,


示例10: zix_tree_remove

ZIX_API ZixStatuszix_tree_remove(ZixTree* t, ZixTreeIter* ti){	ZixTreeNode* const n          = ti;	ZixTreeNode**      pp         = NULL;  // parent pointer	ZixTreeNode*       to_balance = n->parent;  // lowest node to balance	int8_t             d_balance  = 0;  // delta(balance) for n->parent	DEBUG_PRINTF("*** REMOVE %ld/n", (intptr_t)n->data);	if ((n == t->root) && !n->left && !n->right) {		t->root = NULL;		if (t->destroy) {			t->destroy(n->data);		}		free(n);		--t->size;		assert(t->size == 0);		return ZIX_STATUS_SUCCESS;	}	// Set pp to the parent pointer to n, if applicable	if (n->parent) {		assert(n->parent->left == n || n->parent->right == n);		if (n->parent->left == n) {  // n is left child			pp        = &n->parent->left;			d_balance = 1;		} else {  // n is right child			assert(n->parent->right == n);			pp        = &n->parent->right;			d_balance = -1;		}	}	assert(!pp || *pp == n);	int height_change = 0;	if (!n->left && !n->right) {		// n is a leaf, just remove it		if (pp) {			*pp           = NULL;			to_balance    = n->parent;			height_change = (!n->parent->left && !n->parent->right) ? -1 : 0;		}	} else if (!n->left) {		// Replace n with right (only) child		if (pp) {			*pp        = n->right;			to_balance = n->parent;		} else {			t->root = n->right;		}		n->right->parent = n->parent;		height_change    = -1;	} else if (!n->right) {		// Replace n with left (only) child		if (pp) {			*pp        = n->left;			to_balance = n->parent;		} else {			t->root = n->left;		}		n->left->parent = n->parent;		height_change   = -1;	} else {		// Replace n with in-order successor (leftmost child of right subtree)		ZixTreeNode* replace = n->right;		while (replace->left) {			assert(replace->left->parent == replace);			replace = replace->left;		}		// Remove replace from parent (replace_p)		if (replace->parent->left == replace) {			height_change = replace->parent->right ? 0 : -1;			d_balance     = 1;			to_balance    = replace->parent;			replace->parent->left = replace->right;		} else {			assert(replace->parent == n);			height_change = replace->parent->left ? 0 : -1;			d_balance     = -1;			to_balance    = replace->parent;			replace->parent->right = replace->right;		}		if (to_balance == n) {			to_balance = replace;		}		if (replace->right) {			replace->right->parent = replace->parent;		}		replace->balance = n->balance;		// Swap node to delete with replace		if (pp) {			*pp = replace;		} else {//.........这里部分代码省略.........
开发者ID:xuanvu,项目名称:Carla,代码行数:101,


示例11: buildSquashMask

/** * Builds a squash mask based on the pdom tree of v and the given char reach. * The built squash mask is a bit conservative for non-dot cases and could * be improved with a bit of thought. */staticvoid buildSquashMask(NFAStateSet &mask, const NGHolder &g, NFAVertex v,                     const CharReach &cr, const NFAStateSet &init,                     const vector<NFAVertex> &vByIndex, const PostDomTree &tree,                     som_type som, const vector<DepthMinMax> &som_depths,                     const ue2::unordered_map<NFAVertex, u32> &region_map,                     smgb_cache &cache) {    DEBUG_PRINTF("build base squash mask for vertex %u)/n",                 g[v].index);    vector<NFAVertex> q;    PostDomTree::const_iterator it = tree.find(v);    if (it != tree.end()) {        q.insert(q.end(), it->second.begin(), it->second.end());    }    const u32 v_index = g[v].index;    while (!q.empty()) {        NFAVertex u = q.back();        q.pop_back();        const CharReach &cru = g[u].char_reach;        if ((cru & ~cr).any()) {            /* bail: bad cr on vertex u */            /* TODO: this could be better             *             * we still need to ensure that we record any paths leading to u.             * Hence all vertices R which can reach u must be excluded from the             * squash mask. Note: R != pdom(u) and there may exist an x in (R -             * pdom(u)) which is in pdom(y) where y is in q. Clear ?             */            mask.set();            return;        }        const u32 u_index = g[u].index;        if (som) {            /* We cannot add a state u to the squash mask of v if it may have an             * earlier start of match offset. ie for us to add a state u to v             * maxSomDist(u) <= minSomDist(v)             */            const depth &max_som_dist_u = som_depths[u_index].max;            const depth &min_som_dist_v = som_depths[v_index].min;            if (max_som_dist_u.is_infinite()) {                /* it is hard to tell due to the INF if u can actually store an                 * earlier SOM than w (state we are building the squash mask                 * for) - need to think more deeply                 */                if (mustBeSetBefore(u, v, g, cache)                    && !somMayGoBackwards(u, g, region_map, cache)) {                    DEBUG_PRINTF("u %u v %u/n", u_index, v_index);                    goto squash_ok;                }            }           if (max_som_dist_u > min_som_dist_v) {                /* u can't be squashed as it may be storing an earlier SOM */                goto add_children_to_queue;            }        }    squash_ok:        mask.set(u_index);        DEBUG_PRINTF("pdom'ed %u/n", u_index);    add_children_to_queue:        it = tree.find(u);        if (it != tree.end()) {            q.insert(q.end(), it->second.begin(), it->second.end());        }    }    if (cr.all()) {        /* the init states aren't in the pdom tree. If all their succ states         * are set (or v), we can consider them post dominated */        /* Note: init states will always result in a later som */        for (size_t i = init.find_first(); i != init.npos;             i = init.find_next(i)) {            /* Yes vacuous patterns do exist */            NFAVertex iv = vByIndex[i];            for (auto w : adjacent_vertices_range(iv, g)) {                if (w == g.accept || w == g.acceptEod) {                    DEBUG_PRINTF("skipping %zu due to vacuous accept/n", i);                    goto next_init_state;                }                u32 vert_id = g[w].index;                if (w != iv && w != v && !mask.test(vert_id)) {                    DEBUG_PRINTF("skipping %zu due to %u/n", i, vert_id);//.........这里部分代码省略.........
开发者ID:0x4e38,项目名称:hyperscan,代码行数:101,


示例12: zix_tree_insert

ZIX_API ZixStatuszix_tree_insert(ZixTree* t, void* e, ZixTreeIter** ti){	DEBUG_PRINTF("**** INSERT %ld/n", (intptr_t)e);	int          cmp = 0;	ZixTreeNode* n   = t->root;	ZixTreeNode* p   = NULL;	// Find the parent p of e	while (n) {		p   = n;		cmp = t->cmp(e, n->data, t->cmp_data);		if (cmp < 0) {			n = n->left;		} else if (cmp > 0) {			n = n->right;		} else if (t->allow_duplicates) {			n = n->right;		} else {			if (ti) {				*ti = n;			}			DEBUG_PRINTF("%ld EXISTS!/n", (intptr_t)e);			return ZIX_STATUS_EXISTS;		}	}	// Allocate a new node n	if (!(n = (ZixTreeNode*)malloc(sizeof(ZixTreeNode)))) {		return ZIX_STATUS_NO_MEM;	}	memset(n, '/0', sizeof(ZixTreeNode));	n->data    = e;	n->balance = 0;	if (ti) {		*ti = n;	}	bool p_height_increased = false;	// Make p the parent of n	n->parent = p;	if (!p) {		t->root = n;	} else {		if (cmp < 0) {			assert(!p->left);			assert(p->balance == 0 || p->balance == 1);			p->left = n;			--p->balance;			p_height_increased = !p->right;		} else {			assert(!p->right);			assert(p->balance == 0 || p->balance == -1);			p->right = n;			++p->balance;			p_height_increased = !p->left;		}	}	DUMP(t);	// Rebalance if necessary (at most 1 rotation)	assert(!p || p->balance == -1 || p->balance == 0 || p->balance == 1);	if (p && p_height_increased) {		int height_change = 0;		for (ZixTreeNode* i = p; i && i->parent; i = i->parent) {			if (i == i->parent->left) {				if (--i->parent->balance == -2) {					zix_tree_rebalance(t, i->parent, &height_change);					break;				}			} else {				assert(i == i->parent->right);				if (++i->parent->balance == 2) {					zix_tree_rebalance(t, i->parent, &height_change);					break;				}			}			if (i->parent->balance == 0) {				break;			}		}	}	DUMP(t);	++t->size;#ifdef ZIX_TREE_VERIFY	if (!verify(t, t->root)) {		return ZIX_STATUS_ERROR;	}#endif	return ZIX_STATUS_SUCCESS;}
开发者ID:xuanvu,项目名称:Carla,代码行数:98,


示例13: cmodprint

int cmodprint (MODEL *model){    int i, j, n;    struct MODEL_PATH *parent;    char **names;    FILE *f;    int l;    char *fname;    VECTOR_3D size;    VECTOR_3D centre;    float radius;    float rotate;    char *movetype;    VECTOR_3D min, max;    /* We only want LOD0 */    if (model->path.lod != 1){        return 0;    }    /* We don't want destroyed stuff */    if (strstr (model->path.name, "-destroyed")){        return 0;    }        parent = &model->path;    n = model->path.nr_parents;    names = malloc ((n + 1) * sizeof(char *));    ASSERT_PERROR (names != NULL, "Unable to allocate memory for model path");    memset (names, 0, (n + 1) * sizeof(char *));    parent = &model->path;    l = 0;    for (i = n; i >= 0; i--){        names[i] = parent->name;	DEBUG_PRINTF ("# Parent: %s/n", names[i]);	l += strlen(names[i]) + 1;        parent = parent->parent;    }    DEBUG_PRINTF ("# Length: %d/n", l);    fname = malloc (l + 6);    ASSERT_PERROR (fname != NULL, "Unable to allocate memory for model path");    memset (fname, 0, l + 6);    strcpy (fname, names[0]);    for (i=2; i <= n; i++){        strcat (fname, ".");	strcat (fname, names[i]);    }    strcat (fname, ".cmod");    free (names);    f = fopen (fname, "wb");    ASSERT_PERROR (f != NULL, "Unable to open output file");    DEBUG_PRINTF ("# Starting model/n");    fprintf (f, "#celmodel__ascii/n/n");    fprintf (f, "# name: %s/n", fname);    min = rotate_axis (model->min, model->axis);    max = rotate_axis (model->max, model->axis);    size.x = (model->max.x - model->min.x) / 2;    size.y = (model->max.y - model->min.y) / 2;    size.z = (model->max.z - model->min.z) / 2;    centre.x = model->min.x + size.x;    centre.y = model->min.y + size.y;    centre.z = model->min.z + size.z;    radius = size.x;    radius = (size.y > radius) ? size.y : radius;    radius = (size.z > radius) ? size.z : radius;    switch (model->movetype){        case -1: movetype = "None"; break;	case 0: movetype = "Linear"; break;	case 1: movetype = "Rotate"; break;	case 2: movetype = "Turret"; break;	default: movetype = "Unknown";    }    DEBUG_PRINTF ("# Geometric:/n"                "# radius: %f/n"		"# centre: [ %f %f %f ]/n"		"# Celestia:/n"		"# radius: %f/n"		"# centre: [ %f %f %f ]/n"		"# /n"		"# offset: [ %f %f %f ]/n"		"# axis: [ %f %f %f ]/n"		"# movement: %s/n"		"# Properties:/n", 		model->radius,		model->centre.z, model->centre.y, model->centre.x,		radius, 		centre.z, centre.y, centre.x,		model->offset.z, model->offset.y, model->offset.x,		model->axis.z, model->axis.y, model->axis.x,		movetype);    rotate = 8.64e24;#ifdef DEBUGAXIS    if (model->movetype == 1 || model->movetype == 2){        rotate = 3.6;    }#endif//.........这里部分代码省略.........
开发者ID:killerwolves,项目名称:celestia-freespace,代码行数:101,


示例14: main_thread

int main_thread(SceSize args, void *argp){	struct PsplinkContext *ctx;	int ret;	SceUInt timeout;	SceUID thids[20];	int count;	int intc;	printf("PSPLink USB GDBServer (c) 2k7 TyRaNiD/n");	if(!initialise(args, argp))	{		printf("Usage: usbgdb.prx program [args]/n");		sceKernelExitDeleteThread(0);	}	if(usbAsyncRegister(ASYNC_GDB, &g_endp) < 0)	{		printf("Could not register GDB provider/n");		sceKernelExitDeleteThread(0);	}	usbWaitForConnect();	memset(&g_handler, 0, sizeof(g_handler));	g_handler.size = sizeof(g_handler);	g_handler.membase = g_context.info.text_addr;	g_handler.memtop = g_context.info.text_addr + g_context.info.text_size;	g_handler.mbox = sceKernelCreateMbx("GDBMbx", 0, NULL);	if(g_handler.mbox < 0)	{		printf("Could not create message box/n");		sceKernelExitDeleteThread(0);	}	if(debugRegisterEventHandler(&g_handler) < 0)	{		printf("Could not register event handler/n");		sceKernelExitDeleteThread(0);	}	if(GdbHandleException(&g_context.ctx))	{		while(1)		{			timeout = GDB_POLL_TIMEOUT;			ret = debugWaitDebugEvent(&g_handler, &ctx, &timeout);						if(ret == 0)			{				DEBUG_PRINTF("ctx %p, epc 0x%08X/n", ctx, ctx->regs.epc);				ret = GdbHandleException(ctx);				sceKernelWakeupThread(ctx->thid);				if(ret == 0)				{					break;				}			}			else if(ret == SCE_KERNEL_ERROR_WAIT_TIMEOUT)			{				unsigned char ch;				if(peekDebugChar(&ch) && (ch == 3))				{					DEBUG_PRINTF("Break Issued/n");					intc = pspSdkDisableInterrupts();					count = psplinkReferThreadsByModule(SCE_KERNEL_TMID_Thread, g_context.uid, thids, 20);					if(count > 0)					{						/* We just break the first thread */						/* Could in theory break on the thread which we are interested in ? */						debugBreakThread(thids[0]);					}					pspSdkEnableInterrupts(intc);					/* Should have a fallback if it just wont stop						GdbHandleException(&g_context.ctx);					*/				}				continue;			}			else			{				printf("Error waiting for debug event 0x%08X/n", ret);				break;			}		}	}	debugUnregisterEventHandler(&g_handler);	sceKernelExitDeleteThread(0);	return 0;}
开发者ID:yin8086,项目名称:psplinkusb,代码行数:93,


示例15: expandCyclic

staticbool expandCyclic(NGHolder &h, NFAVertex v) {    DEBUG_PRINTF("inspecting %zu/n", h[v].index);    bool changes = false;    auto v_preds = preds(v, h);    auto v_succs = succs(v, h);    set<NFAVertex> start_siblings;    set<NFAVertex> end_siblings;    CharReach &v_cr = h[v].char_reach;    /* We need to find start vertices which have all of our preds.     * As we have a self loop, it must be one of our succs. */    for (auto a : adjacent_vertices_range(v, h)) {        auto a_preds = preds(a, h);        if (a_preds == v_preds && isutf8start(h[a].char_reach)) {            DEBUG_PRINTF("%zu is a start v/n", h[a].index);            start_siblings.insert(a);        }    }    /* We also need to find full cont vertices which have all our own succs;     * As we have a self loop, it must be one of our preds. */    for (auto a : inv_adjacent_vertices_range(v, h)) {        auto a_succs = succs(a, h);        if (a_succs == v_succs && h[a].char_reach == UTF_CONT_CR) {            DEBUG_PRINTF("%zu is a full tail cont/n", h[a].index);            end_siblings.insert(a);        }    }    for (auto s : start_siblings) {        if (out_degree(s, h) != 1) {            continue;        }        const CharReach &cr = h[s].char_reach;        if (cr.isSubsetOf(UTF_TWO_START_CR)) {            if (end_siblings.find(*adjacent_vertices(s, h).first)                == end_siblings.end()) {                DEBUG_PRINTF("%zu is odd/n", h[s].index);                continue;            }        } else if (cr.isSubsetOf(UTF_THREE_START_CR)) {            NFAVertex m = *adjacent_vertices(s, h).first;            if (h[m].char_reach != UTF_CONT_CR                || out_degree(m, h) != 1) {                continue;            }            if (end_siblings.find(*adjacent_vertices(m, h).first)                == end_siblings.end()) {                DEBUG_PRINTF("%zu is odd/n", h[s].index);                continue;            }        } else if (cr.isSubsetOf(UTF_FOUR_START_CR)) {            NFAVertex m1 = *adjacent_vertices(s, h).first;            if (h[m1].char_reach != UTF_CONT_CR                || out_degree(m1, h) != 1) {                continue;            }            NFAVertex m2 = *adjacent_vertices(m1, h).first;            if (h[m2].char_reach != UTF_CONT_CR                || out_degree(m2, h) != 1) {                continue;            }            if (end_siblings.find(*adjacent_vertices(m2, h).first)                == end_siblings.end()) {                DEBUG_PRINTF("%zu is odd/n", h[s].index);                continue;            }        } else {            DEBUG_PRINTF("%zu is bad/n", h[s].index);          continue;        }        v_cr |= cr;        clear_vertex(s, h);        changes = true;    }    if (changes) {        v_cr |= UTF_CONT_CR; /* we need to add in cont reach */        v_cr.set(0xc0); /* we can also add in the forbidden bytes as we require                         * valid unicode data */        v_cr.set(0xc1);        v_cr |= CharReach(0xf5, 0xff);    }    return changes;}
开发者ID:tomzhang,项目名称:hyperscan,代码行数:99,


示例16: rtems_ftpfs_open_data_connection_passive

static int rtems_ftpfs_open_data_connection_passive(  rtems_ftpfs_entry *e,  uint32_t client_address,  const char *file_command,  const char *filename,  bool verbose,  const struct timeval *timeout){  int rv = 0;  rtems_ftpfs_reply reply = RTEMS_FTPFS_REPLY_ERROR;  struct sockaddr_in sa;  uint32_t data_address = 0;  uint16_t data_port = 0;  rtems_ftpfs_pasv_entry pe = {    .state = RTEMS_FTPFS_PASV_START  };  /* Send PASV command */  reply = rtems_ftpfs_send_command_with_parser(    e,    "PASV",    NULL,    rtems_ftpfs_pasv_parser,    &pe,    verbose  );  if (reply != RTEMS_FTPFS_REPLY_2) {    return ENOTSUP;  }  data_address = ((uint32_t)(pe.data [0]) << 24) + ((uint32_t)(pe.data [1]) << 16)    + ((uint32_t)(pe.data [2]) << 8) + ((uint32_t)(pe.data [3]));  data_port = (uint16_t) ((pe.data [4] << 8) + pe.data [5]);  rtems_ftpfs_create_address(&sa, htonl(data_address), htons(data_port));  DEBUG_PRINTF(    "server data = %s:%u/n",    inet_ntoa(sa.sin_addr),    (unsigned) ntohs(sa.sin_port)  );  /* Create data socket */  e->data_socket = socket(AF_INET, SOCK_STREAM, 0);  if (e->data_socket < 0) {    return ENOMEM;  }  /* Open data connection */  rv = connect(    e->data_socket,    (struct sockaddr *) &sa,    sizeof(sa)  );  if (rv != 0) {    return EIO;  }  /* Send RETR or STOR command with filename */  reply = rtems_ftpfs_send_command(e, file_command, filename, verbose);  if (reply != RTEMS_FTPFS_REPLY_1) {    return EIO;  }  return 0;}
开发者ID:aniwang2013,项目名称:leon-rtems,代码行数:65,


示例17: output_suggest_visit

static void output_suggest_visit(rb_node *node, void *data){  FILE *out = data;  string *word = node->data;  DEBUG_PRINTF("/t%.*s/n", (int)word->sz, word->str);  fprintf(out, "/t%.*s/n", (int)word->sz, word->str);}
开发者ID:hitchiker42,项目名称:my-code,代码行数:6,


示例18: rtems_ftpfs_open

static int rtems_ftpfs_open(  rtems_libio_t *iop,  const char *path,  int oflag,  mode_t mode){  int eno = 0;  bool ok = false;  rtems_ftpfs_entry *e = NULL;  rtems_ftpfs_mount_entry *me = iop->pathinfo.mt_entry->fs_info;  bool verbose = me->verbose;  const struct timeval *timeout = &me->timeout;  const char *user = NULL;  const char *password = NULL;  const char *hostname = NULL;  const char *filename = NULL;  const char *file_command = (iop->flags & LIBIO_FLAGS_WRITE) != 0    ? "STOR "    : "RETR ";  uint32_t client_address = 0;  char *location = iop->pathinfo.node_access;  /* Invalidate data handle */  iop->data1 = NULL;  /* Split location into parts */  ok = rtems_ftpfs_split_names(      location,      &user,      &password,      &hostname,      &filename  );  if (!ok) {    rtems_set_errno_and_return_minus_one(ENOENT);  }  DEBUG_PRINTF(    "user = '%s', password = '%s', filename = '%s'/n",    user,    password,    filename  );  /* Check for either read-only or write-only flags */  if (    (iop->flags & LIBIO_FLAGS_WRITE) != 0      && (iop->flags & LIBIO_FLAGS_READ) != 0  ) {    rtems_set_errno_and_return_minus_one(ENOTSUP);  }  /* Allocate connection entry */  e = calloc(1, sizeof(*e));  if (e == NULL) {    rtems_set_errno_and_return_minus_one(ENOMEM);  }  /* Initialize connection entry */  e->ctrl_socket = -1;  e->data_socket = -1;  /* Save connection state */  iop->data1 = e;  /* Open control connection */  eno = rtems_ftpfs_open_ctrl_connection(    e,    user,    password,    hostname,    &client_address,    verbose,    timeout  );  if (eno != 0) {    goto cleanup;  }  /* Open passive data connection */  eno = rtems_ftpfs_open_data_connection_passive(    e,    client_address,    file_command,    filename,    verbose,    timeout  );  if (eno == ENOTSUP) {    /* Open active data connection */    eno = rtems_ftpfs_open_data_connection_active(      e,      client_address,      file_command,      filename,      verbose,      timeout    );  }  if (eno != 0) {//.........这里部分代码省略.........
开发者ID:aniwang2013,项目名称:leon-rtems,代码行数:101,


示例19: factor

/*---------------------------------------------------------------------------*/static void factor(struct typevalue *v){  uint8_t t = current_token;  int len;  struct typevalue arg[3];  DEBUG_PRINTF("factor: token %d/n", current_token);  switch(t) {  case TOKENIZER_STRING:    v->type = TYPE_STRING;    len = tokenizer_string_len();    v->d.p = string_temp(len);    memcpy(v->d.p + 1, tokenizer_string(), len);    DEBUG_PRINTF("factor: string %p/n", v->d.p);    accept_tok(TOKENIZER_STRING);    break;  case TOKENIZER_NUMBER:    v->d.i = tokenizer_num();    v->type = TYPE_INTEGER;    DEBUG_PRINTF("factor: number %d/n", v->d.i);    accept_tok(TOKENIZER_NUMBER);    break;  case TOKENIZER_LEFTPAREN:    accept_tok(TOKENIZER_LEFTPAREN);    expr(v);    accept_tok(TOKENIZER_RIGHTPAREN);    break;  case TOKENIZER_INTVAR:  case TOKENIZER_STRINGVAR:    varfactor(v);    break;  default:    if (TOKENIZER_NUMEXP(t)) {      accept_tok(t);      switch(t) {      case TOKENIZER_PEEK:        funcexpr(arg,"I");        v->d.i = peek_function(arg[0].d.i);        break;      case TOKENIZER_ABS:        funcexpr(arg,"I");        v->d.i = arg[0].d.i;        if (v->d.i < 0)          v->d.i = -v->d.i;        break;      case TOKENIZER_INT:        funcexpr(arg,"I");        v->d.i = arg[0].d.i;        break;      case TOKENIZER_SGN:        funcexpr(arg,"I");        v->d.i = arg[0].d.i;        if (v->d.i > 1 ) v->d.i = 1;        if (v->d.i < 0) v->d.i = -1;        break;      case TOKENIZER_LEN:        funcexpr(arg,"S");        v->d.i = *arg[0].d.p;        break;      case TOKENIZER_CODE:        funcexpr(arg,"S");        if (*arg[0].d.p)          v->d.i = arg[0].d.p[1];        else          v->d.i = 0;        break;      case TOKENIZER_VAL:        funcexpr(arg,"S");        v->d.i = string_val(&arg[0]);        break;      default:        syntax_error();      }      v->type = TYPE_INTEGER;    }    else if (TOKENIZER_STRINGEXP(t)) {      accept_tok(t);      switch(t) {      case TOKENIZER_LEFTSTR:        funcexpr(arg, "SI");        string_cut(v, &arg[0], 1, arg[1].d.i);        break;      case TOKENIZER_RIGHTSTR:        funcexpr(arg, "SI");        string_cut_r(v, &arg[0], arg[1].d.i);        break;      case TOKENIZER_MIDSTR:        funcexpr(arg, "SII");        string_cut(v, &arg[0], arg[1].d.i, arg[2].d.i);        break;      case TOKENIZER_CHRSTR:        funcexpr(arg, "I");        v->d.p = string_temp(2);        v->d.p[1] = arg[0].d.i;        v->type = TYPE_STRING;        break;      default:        syntax_error();      }//.........这里部分代码省略.........
开发者ID:EtchedPixels,项目名称:ubasic,代码行数:101,


示例20: report_workaround

static int report_workaround(char *s) {  DEBUG_PRINTF((s));  return 1;}
开发者ID:c0ns0le,项目名称:SysToolsLib,代码行数:4,


示例21: system_init_done_cb

/** @brief Callback for system_init_done_cb()  Sends message to run task @return void*/MEMSPACE LOCAL void init_done_cb( void){	DEBUG_PRINTF("System init done /r/n");}
开发者ID:sergey-kaydalov,项目名称:esp8266_ili9341-1,代码行数:10,


示例22: closedir

int closedir(DIR *pDir) { /* Close the directory. Return 0 if successful, -1 if not. */  DEBUG_PRINTF(("closedir(0x%p);/n", pDir));  if (pDir) free(pDir);  return 0;}
开发者ID:c0ns0le,项目名称:SysToolsLib,代码行数:5,


示例23: main

/** @brief main() Initialize user task @return void*/MEMSPACE void user_init(void){	int i;	os_event_t *handlerQueue;    char time[20];	int ret;	uint16_t *ptr;	uint32_t time1,time2;	uint32_t ID;	extern uint16_t tft_ID;	double ang;	os_delay_us(200000L);	// Power Up dalay - lets power supplies and devices settle	// Configure the UART	uart_init(BIT_RATE_115200,BIT_RATE_115200);	DEBUG_PRINTF("/n");	DEBUG_PRINTF("System init.../n");	DEBUG_PRINTF("HSPI init.../n");	hspi_init(1,0);	DEBUG_PRINTF("Timers init.../n");	init_timers();	DEBUG_PRINTF("SD Card init.../n");	mmc_init(1);// CPU// 160MHZ//  REG_SET_BIT(0x3ff00014, BIT(0));// 80MHZ//   REG_CLR_BIT(0x3ff00014, BIT(0));	DEBUG_PRINTF("Display Init/n");	// Initialize TFT	master = tft_init();	ID = tft_ID;	// Set master rotation	tft_setRotation(1);	/* Setup main status window */	tft_window_init(winstats,0,0, master->w * 7 / 10, master->h/2);	tft_setpos(winstats, 0,0);	tft_set_font(winstats,5);	tft_font_var(winstats);	tft_setTextColor(winstats, ILI9341_RED,0);	tft_printf(winstats, "DISP ID: %04lx/n", ID);	ip_xpos = winstats->x;	ip_ypos = winstats->y;	tft_printf(winstats, "/n");	tft_setTextColor(winstats, ILI9341_WHITE,0);#if ILI9341_DEBUG & 1	DEBUG_PRINTF("/nDisplay ID=%08lx/n",ID);#endif	tft_font_fixed(winstats);	// Save last display offset of the status update line - used in the demo task	xpos = winstats->x;	ypos = winstats->y;	/* Setup cube/wireframe demo window */	tft_window_init(windemo,winstats->w,0, master->w - winstats->w, master->h/2);// Cube points were defined with sides of 1.0 // We want a scale of +/- w/2	if(windemo->w < windemo->h) 		dscale_max = windemo->w/2;	else		dscale_max = windemo->h/2;	dscale = dscale_max;	dscale_inc = dscale_max / 100;/* Setup second window for window testing*/	tft_window_init(wintest,0,master->h/2, master->w/2, master->h/2);	tft_setTextColor(wintest, ILI9341_WHITE,ILI9341_NAVY);    tft_fillWin(wintest, wintest->bg);	tft_set_font(wintest,3);	//tft_font_var(wintest);	// write some text	tft_setpos(wintest, 0,0);	tft_printf(wintest, "Test1/nTest2/nTest3");	/* Test demo area window */	tft_window_init(wintestdemo,master->w/2,master->h/2,master->w/2, master->h/2);	tft_setTextColor(wintestdemo, ILI9341_WHITE,0);    tft_fillWin(wintestdemo, wintestdemo->bg);	tft_set_font(wintestdemo,3);	tft_font_var(wintestdemo);//.........这里部分代码省略.........
开发者ID:sergey-kaydalov,项目名称:esp8266_ili9341-1,代码行数:101,


示例24: markFastSafeFn

static boolmarkFastSafeFn(FnSymbol *fn, int recurse, Vec<FnSymbol*> *visited) {  if (fn->hasFlag(FLAG_FAST_ON))    return true;  if (fn->hasFlag(FLAG_EXPORT))    return true;  if (fn->hasFlag(FLAG_EXTERN)) {    // consider a pragma to indicate that it would be "fast"    return false;  }  if (fn->hasFlag(FLAG_NON_BLOCKING))    return false;  visited->add_exclusive(fn);  std::vector<CallExpr*> calls;  collectCallExprs(fn, calls);  for_vector(CallExpr, call, calls) {    DEBUG_PRINTF("/tcall %p (id=%d): ", call, call->id);    bool isLocal = fn->hasFlag(FLAG_LOCAL_FN) || inLocalBlock(call);    if (!call->primitive) {      DEBUG_PRINTF("(non-primitive CALL)/n");      if ((recurse>0) && call->isResolved()) {        if (call->isResolved()->hasFlag(FLAG_ON_BLOCK)) {          visited->add_exclusive(call->isResolved());          call->isResolved()->removeFlag(FLAG_FAST_ON);          DEBUG_PRINTF("%d: recurse FAILED (nested on block, id=%d)./n",                       recurse-1, call->id);          return false;        }        if (!visited->in(call->isResolved())) {          DEBUG_PRINTF("%d: recurse %p (block=%p, id=%d)/n", recurse-1,                       call->isResolved(), call->isResolved()->body,                       call->isResolved()->id);          DEBUG_PRINTF("/tlength=%d/n", call->isResolved()->body->length());          if (!markFastSafeFn(call->isResolved(), recurse-1, visited)) {            DEBUG_PRINTF("%d: recurse FAILED (id=%d)./n", recurse-1, call->id);            return false;          }        } else {          DEBUG_PRINTF("%d: recurse ALREADY VISITED %p (id=%d)/n", recurse-1,                       call->isResolved(), call->isResolved()->id);          DEBUG_PRINTF("/tlength=%d/n", call->isResolved()->body->length());        }        DEBUG_PRINTF("%d: recurse DONE./n", recurse-1);      } else {        // No function calls allowed        DEBUG_PRINTF("%d: recurse FAILED (%s, id=%d)./n", recurse-1,                     recurse == 1 ? "too deep" : "function not resolved",                     call->id);        return false;      }    } else if (isFastPrimitive(call, isLocal)) {      DEBUG_PRINTF(" (FAST primitive CALL)/n");    } else {      DEBUG_PRINTF("%d: FAILED (non-FAST primitive CALL: %s, id=%d)/n",                   recurse-1, call->primitive->name, call->id);      return false;    }  }
开发者ID:CoryMcCartan,项目名称:chapel,代码行数:66,


示例25: freespace_private_devicePerform

int freespace_private_devicePerform(struct FreespaceDeviceStruct* device) {    int idx;    BOOL overlappedResult;    struct FreespaceSendStruct* send;	int rc;	struct freespace_message m;    // Handle the send messages    for (idx = 0; idx < FREESPACE_MAXIMUM_SEND_MESSAGE_COUNT; idx++) {        send = &device->send_[idx];        if (send->interface_ == NULL) {            continue;        }        overlappedResult = GetOverlappedResult(                                               send->interface_->handle_,                                               &send->overlapped_,                                               &send->numBytes_,                                               FALSE);        if (!overlappedResult) {            // No message available yet.            continue;        } else if (send->numBytes_ != send->interface_->info_.outputReportByteLength_) {            // Unexpected error on the sent message.            DEBUG_PRINTF("freespace_private_devicePerform: error on message size: %d != %d/n",                         send->numBytes_, send->interface_->info_.outputReportByteLength_);            if (send->callback_ != NULL) {                send->callback_(device->id_, send->cookie_, FREESPACE_ERROR_IO);            }        } else {            // successfully sent message            if (send->callback_ != NULL) {                send->callback_(device->id_, send->cookie_, FREESPACE_SUCCESS);            }        }        if (finalizeSendStruct(send, FALSE) != FREESPACE_SUCCESS) {            DEBUG_PRINTF("freespace_private_devicePerform: error while sending message");        }    }    // Call GetOverlappedResult() on everything to check what    // messages were received.    for (idx = 0; idx < device->handleCount_; idx++) {        struct FreespaceSubStruct* s = &device->handle_[idx];        if (s->readStatus_) {            int lastErr;            BOOL bResult = GetOverlappedResult(                                               s->handle_,                 /* handle to device */                                               &s->readOverlapped_,        /* long pointer to an OVERLAPPED structure */                                               &s->readBufferSize,         /* returned buffer size */                                               FALSE);            lastErr = GetLastError();            if (bResult) {                // Got something, so report it.                if (device->receiveCallback_ || device->receiveMessageCallback_) {					if (device->receiveCallback_) {						device->receiveCallback_(device->id_, (char *) (s->readBuffer), s->readBufferSize, device->receiveCookie_, FREESPACE_SUCCESS);					}					if (device->receiveMessageCallback_) {						rc = freespace_decode_message((char *) (s->readBuffer), s->readBufferSize, &m, device->hVer_);						if (rc == FREESPACE_SUCCESS) {							device->receiveMessageCallback_(device->id_, &m, device->receiveMessageCookie_, FREESPACE_SUCCESS);						} else {							device->receiveMessageCallback_(device->id_, NULL, device->receiveMessageCookie_, rc);							DEBUG_PRINTF("freespace_decode_message failed with code %d/n", rc);						}					}				}                s->readStatus_ = FALSE;            } else if (lastErr != ERROR_IO_INCOMPLETE) {                // Something severe happened to our device!				DEBUG_PRINTF("freespace_private_devicePerform : Error on %d : %d/n", idx, lastErr);                if (device->receiveCallback_) {				    device->receiveCallback_(device->id_, NULL, 0, device->receiveCookie_, FREESPACE_ERROR_NO_DATA);				}				if (device->receiveMessageCallback_) {				    device->receiveMessageCallback_(device->id_, NULL, device->receiveMessageCookie_, FREESPACE_ERROR_NO_DATA);				}                return handleDeviceFailure(device, lastErr);            }        }    }    // Re-initiate the ReadFile calls for the next go around.    return initiateAsyncReceives(device);}
开发者ID:cobbchaseRazer,项目名称:libfreespace,代码行数:87,


示例26: isFastPrimitive

//// Return true if this primitive function is safe for fast on optimization// (e.g., no communication, no sync/single accesses)//static boolisFastPrimitive(CallExpr *call, bool isLocal) {  INT_ASSERT(call->primitive);  // Check primitives for communication  switch (call->primitive->tag) {  case PRIM_UNKNOWN:    // TODO: Return true for PRIM_UNKNOWNs that are side-effect free    return false;  case PRIM_NOOP:  case PRIM_REF_TO_STRING:  case PRIM_RETURN:  case PRIM_UNARY_MINUS:  case PRIM_UNARY_PLUS:  case PRIM_UNARY_NOT:  case PRIM_UNARY_LNOT:  case PRIM_ADD:  case PRIM_SUBTRACT:  case PRIM_MULT:  case PRIM_DIV:  case PRIM_MOD:  case PRIM_LSH:  case PRIM_RSH:  case PRIM_EQUAL:  case PRIM_NOTEQUAL:  case PRIM_LESSOREQUAL:  case PRIM_GREATEROREQUAL:  case PRIM_LESS:  case PRIM_GREATER:  case PRIM_AND:  case PRIM_OR:  case PRIM_XOR:  case PRIM_POW:  case PRIM_MIN:  case PRIM_MAX:  case PRIM_GET_MEMBER:  case PRIM_GET_SVEC_MEMBER:  case PRIM_GET_PRIV_CLASS:  case PRIM_NEW_PRIV_CLASS:  case PRIM_CHECK_NIL:  case PRIM_GET_REAL:  case PRIM_GET_IMAG:  case PRIM_ADDR_OF:  case PRIM_LOCAL_CHECK:  case PRIM_INIT_FIELDS:  case PRIM_PTR_EQUAL:  case PRIM_PTR_NOTEQUAL:  case PRIM_CAST:  case PRIM_BLOCK_LOCAL:  case PRIM_ON_LOCALE_NUM:  case PRIM_GET_SERIAL:  case PRIM_SET_SERIAL:  case PRIM_START_RMEM_FENCE:  case PRIM_FINISH_RMEM_FENCE:  case PRIM_STRING_COPY:  case PRIM_C_STRING_FROM_STRING:  case PRIM_CAST_TO_VOID_STAR:  case PRIM_SIZEOF:  case PRIM_GET_USER_LINE:  case PRIM_GET_USER_FILE:    DEBUG_PRINTF(" *** OK (default): %s/n", call->primitive->name);    return true;  case PRIM_MOVE:  case PRIM_ASSIGN:  case PRIM_ADD_ASSIGN:  case PRIM_SUBTRACT_ASSIGN:  case PRIM_MULT_ASSIGN:  case PRIM_DIV_ASSIGN:  case PRIM_MOD_ASSIGN:  case PRIM_LSH_ASSIGN:  case PRIM_RSH_ASSIGN:  case PRIM_AND_ASSIGN:  case PRIM_OR_ASSIGN:  case PRIM_XOR_ASSIGN:    if (!isCallExpr(call->get(2))) { // callExprs checked in calling function      if (!call->get(1)->typeInfo()->symbol->hasFlag(FLAG_WIDE_REF) &&          !call->get(2)->typeInfo()->symbol->hasFlag(FLAG_WIDE_REF)) {        DEBUG_PRINTF(" *** OK (PRIM_MOVE 1): %s/n", call->primitive->name);        return true;      }    } else {      DEBUG_PRINTF(" *** OK (PRIM_MOVE 2): %s/n", call->primitive->name);      // Not necessarily true, but we return true because      // the callExpr will be checked in the calling function      return true;    }//.........这里部分代码省略.........
开发者ID:CoryMcCartan,项目名称:chapel,代码行数:101,


示例27: freespace_private_send

int freespace_private_send(FreespaceDeviceId id,                           const uint8_t* report,                           int length) {    struct FreespaceSendStruct* send;    int retVal = 0;    DWORD lastError = 0;    retVal = prepareSend(id, &send, report, length);    if (retVal != FREESPACE_SUCCESS) {        return retVal;    }    // Send the message    retVal = freespace_send_activate(send);    if (retVal != FREESPACE_ERROR_IO) {        return retVal;    }    // Wait for the message to be sent    lastError = WaitForSingleObject(send->overlapped_.hEvent, SEND_TIMEOUT);    if (lastError != WAIT_OBJECT_0) {        // timed out        BOOL overlappedResult = GetOverlappedResult(send->interface_->handle_,                                                    &send->overlapped_,                                                    &send->numBytes_,                                                    FALSE);        // Abort any pending messages and return        // WARNING: CancelIo will also affect READ!        DEBUG_PRINTF("freespace_send: error on WaitForSingleObject = %d/n", lastError);        CancelIo(send->interface_->handle_);        send->interface_->readStatus_ = FALSE;        if (overlappedResult) {            send->rc_ = FREESPACE_ERROR_TIMEOUT;        } else {            send->rc_ = FREESPACE_ERROR_IO; //FREESPACE_OS_ERROR_BASE - lastError;        }    } else {        // success        BOOL overlappedResult = GetOverlappedResult(send->interface_->handle_,                                                    &send->overlapped_,                                                    &send->numBytes_,                                                    TRUE);        if (!overlappedResult) {            DEBUG_PRINTF("freespace_send: error on GetOverlappedResult/n");            send->rc_ = FREESPACE_ERROR_IO;        } else if (send->numBytes_ != send->interface_->info_.outputReportByteLength_) {            DEBUG_PRINTF("freespace_send: error on message size: %d != %d/n",                         send->numBytes_, send->interface_->info_.outputReportByteLength_);            send->rc_ = FREESPACE_ERROR_IO;        } else {            // successfully sent message            send->rc_ = FREESPACE_SUCCESS;        }    }    return finalizeSendStruct(send, FALSE);}
开发者ID:cobbchaseRazer,项目名称:libfreespace,代码行数:62,


示例28: findSeeds

staticvoid findSeeds(const NGHolder &h, const bool som, vector<NFAVertex> *seeds) {    set<NFAVertex> bad; /* from zero-width asserts near accepts, etc */    for (auto v : inv_adjacent_vertices_range(h.accept, h)) {        const CharReach &cr = h[v].char_reach;        if (!isutf8ascii(cr) && !isutf8start(cr)) {            bad.insert(v);        }    }    for (auto v : inv_adjacent_vertices_range(h.acceptEod, h)) {        const CharReach &cr = h[v].char_reach;        if (!isutf8ascii(cr) && !isutf8start(cr)) {            bad.insert(v);        }    }    // we want to be careful with asserts connected to starts    // as well as they may not finish a code point    for (auto v : vertices_range(h)) {        if (is_virtual_start(v, h)) {            bad.insert(v);            insert(&bad, adjacent_vertices(v, h));        }    }    /* we cannot handle vertices connected to accept as would report matches in     * the middle of codepoints. acceptEod is not a problem as the input must     * end at a codepoint boundary */    bad.insert(h.accept);    // If we're in SOM mode, we don't want to mess with vertices that have a    // direct edge from startDs.    if (som) {        insert(&bad, adjacent_vertices(h.startDs, h));    }    set<NFAVertex> already_seeds; /* already marked as seeds */    for (auto v : vertices_range(h)) {        const CharReach &cr = h[v].char_reach;        if (!isutf8ascii(cr) || !hasSelfLoop(v, h)) {            continue;        }        if (hasSuccInSet(h, v, bad)) {            continue;        }        // Skip vertices that are directly connected to other vertices already        // in the seeds list: we can't collapse two of these directly next to        // each other.        if (hasPredInSet(h, v, already_seeds) ||            hasSuccInSet(h, v, already_seeds)) {            continue;        }        DEBUG_PRINTF("%zu is a seed/n", h[v].index);        seeds->push_back(v);        already_seeds.insert(v);    }}
开发者ID:tomzhang,项目名称:hyperscan,代码行数:62,


示例29: HAL_RCC_CSSCallback

void HAL_RCC_CSSCallback(void) {	DEBUG_PRINTF("Oh no! HAL_RCC_CSSCallback()/r/n");}
开发者ID:faa,项目名称:purethermal1-firmware,代码行数:3,


示例30: fc3d_AC_initialize

static void fc3d_AC_initialize(FrictionContactProblem* problem,                               FrictionContactProblem* localproblem,                               SolverOptions * options){  /** In initialize, these operators are "connected" to their corresponding static variables,   * that will be used to build local problem for each considered contact.   * Local problem is built during call to update (which depends on the storage type for M).   */  DEBUG_PRINTF("fc3d_AC_initialize starts with options->iparam[10] = %i/n",               options->iparam[SICONOS_FRICTION_3D_NSN_FORMULATION]);  if (options->iparam[SICONOS_FRICTION_3D_NSN_FORMULATION] ==      SICONOS_FRICTION_3D_NSN_FORMULATION_ALARTCURNIER_STD )  {    Function = &(computeAlartCurnierSTD);  }  else if (options->iparam[SICONOS_FRICTION_3D_NSN_FORMULATION] ==           SICONOS_FRICTION_3D_NSN_FORMULATION_JEANMOREAU_STD )  {    Function = &(computeAlartCurnierJeanMoreau);  }  else if (options->iparam[SICONOS_FRICTION_3D_NSN_FORMULATION] ==           SICONOS_FRICTION_3D_NSN_FORMULATION_ALARTCURNIER_GENERATED )  {    Function = &(fc3d_AlartCurnierFunctionGenerated);  }  else if (options->iparam[SICONOS_FRICTION_3D_NSN_FORMULATION] ==           SICONOS_FRICTION_3D_NSN_FORMULATION_JEANMOREAU_GENERATED )  {    Function = &fc3d_AlartCurnierJeanMoreauFunctionGenerated;;  }  else if (options->iparam[SICONOS_FRICTION_3D_NSN_FORMULATION] ==           SICONOS_FRICTION_3D_NSN_FORMULATION_NULL)  {    Function = NULL;  }  /* Compute and store default value of rho value */  int nc = problem->numberOfContacts;  double avg_rho[3] = {0.0, 0.0, 0.0};  if (options->solverId == SICONOS_FRICTION_3D_ONECONTACT_NSN ||      options->solverId == SICONOS_FRICTION_3D_ONECONTACT_NSN_GP)  {    if (!options->dWork ||        options->dWorkSize < 3*nc)    {      options->dWork = (double *)realloc(options->dWork,                                         3*nc * sizeof(double));      options->dWorkSize = 3*nc ;    }  }  else if (options->solverId == SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_HYBRID)  {    if (!options->dWork ||        options->dWorkSize < 4*nc)    {      options->dWork = (double *)realloc(options->dWork,                                         4*nc * sizeof(double));      options->dWorkSize = 4*nc ;    }  }    double  * rho;  for (int contact =0; contact <nc ; contact++)  {    if (options->solverId == SICONOS_FRICTION_3D_ONECONTACT_NSN ||        options->solverId == SICONOS_FRICTION_3D_ONECONTACT_NSN_GP)    {      rho = &options->dWork[3*contact];    }    else if (options->solverId == SICONOS_FRICTION_3D_ONECONTACT_NSN_GP_HYBRID)    {      options->dWork[contact] = 1.0; // for PLI algorithm.      rho = &options->dWork[3*contact+nc];    }    numerics_printf("fc3d_AC_initialize "" compute rho for contact = %i",contact);    if (options->iparam[SICONOS_FRICTION_3D_NSN_RHO_STRATEGY] == SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPLIT_SPECTRAL_NORM_COND)    {      fc3d_local_problem_fill_M(problem, localproblem, contact);      compute_rho_split_spectral_norm_cond(localproblem, rho);    }    else if (options->iparam[SICONOS_FRICTION_3D_NSN_RHO_STRATEGY] == SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPLIT_SPECTRAL_NORM)    {      fc3d_local_problem_fill_M(problem, localproblem, contact);      compute_rho_split_spectral_norm(localproblem, rho);    }    else if (options->iparam[SICONOS_FRICTION_3D_NSN_RHO_STRATEGY] == SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_SPECTRAL_NORM)    {      fc3d_local_problem_fill_M(problem, localproblem, contact);      compute_rho_spectral_norm(localproblem, rho);    }    else if (options->iparam[SICONOS_FRICTION_3D_NSN_RHO_STRATEGY] == SICONOS_FRICTION_3D_NSN_FORMULATION_RHO_STRATEGY_CONSTANT)    {      rho[0]=options->dparam[SICONOS_FRICTION_3D_NSN_RHO];//.........这里部分代码省略.........
开发者ID:siconos,项目名称:siconos,代码行数:101,



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


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