这篇教程C++ swaps函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中swaps函数的典型用法代码示例。如果您正苦于以下问题:C++ swaps函数的具体用法?C++ swaps怎么用?C++ swaps使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了swaps函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SProcCreateGlyphCursorintSProcCreateGlyphCursor (ClientPtr client){ char n; REQUEST(xCreateGlyphCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); swapl(&stuff->cid, n); swapl(&stuff->source, n); swapl(&stuff->mask, n); swaps(&stuff->sourceChar, n); swaps(&stuff->maskChar, n); swaps(&stuff->foreRed, n); swaps(&stuff->foreGreen, n); swaps(&stuff->foreBlue, n); swaps(&stuff->backRed, n); swaps(&stuff->backGreen, n); swaps(&stuff->backBlue, n); return((* ProcVector[X_CreateGlyphCursor])(client));}
开发者ID:Agnarr,项目名称:xserver,代码行数:20,
示例2: XETSwWarpPointervoid XETSwWarpPointer(register xWarpPointerReq *data){ register char n; swaps(&(data->length), n); swapl(&(data->srcWid), n); swapl(&(data->dstWid), n); swaps(&(data->srcX), n); swaps(&(data->srcY), n); swaps(&(data->srcWidth), n); swaps(&(data->srcHeight), n); swaps(&(data->dstX), n); swaps(&(data->dstY), n);}
开发者ID:narenas,项目名称:nx-libs,代码行数:13,
示例3: SProcShmPutImagestatic intSProcShmPutImage(ClientPtr client){ REQUEST(xShmPutImageReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmPutImageReq); swapl(&stuff->drawable); swapl(&stuff->gc); swaps(&stuff->totalWidth); swaps(&stuff->totalHeight); swaps(&stuff->srcX); swaps(&stuff->srcY); swaps(&stuff->srcWidth); swaps(&stuff->srcHeight); swaps(&stuff->dstX); swaps(&stuff->dstY); swapl(&stuff->shmseg); swapl(&stuff->offset); return ProcShmPutImage(client);}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:20,
示例4: ProcRRGetCrtcTransformintProcRRGetCrtcTransform(ClientPtr client){ REQUEST(xRRGetCrtcTransformReq); xRRGetCrtcTransformReply *reply; RRCrtcPtr crtc; int nextra; RRTransformPtr current, pending; char *extra; REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); pending = &crtc->client_pending_transform; current = &crtc->client_current_transform; nextra = (transform_filter_length(pending) + transform_filter_length(current)); reply = malloc(sizeof(xRRGetCrtcTransformReply) + nextra); if (!reply) return BadAlloc; extra = (char *) (reply + 1); reply->type = X_Reply; reply->sequenceNumber = client->sequence; reply->length = bytes_to_int32(CrtcTransformExtra + nextra); reply->hasTransforms = crtc->transforms; transform_encode(client, &reply->pendingTransform, &pending->transform); extra += transform_filter_encode(client, extra, &reply->pendingNbytesFilter, &reply->pendingNparamsFilter, pending); transform_encode(client, &reply->currentTransform, ¤t->transform); extra += transform_filter_encode(client, extra, &reply->currentNbytesFilter, &reply->currentNparamsFilter, current); if (client->swapped) { swaps(&reply->sequenceNumber); swapl(&reply->length); } WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, (char *) reply); free(reply); return Success;}
开发者ID:RavenB,项目名称:turbovnc,代码行数:49,
示例5: SWriteListImageFormatsReplystatic intSWriteListImageFormatsReply( ClientPtr client, xvListImageFormatsReply *rep){ char n; swaps(&rep->sequenceNumber, n); swapl(&rep->length, n); swapl(&rep->num_formats, n); (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep); return Success;}
开发者ID:eriytt,项目名称:xserver-xsdl,代码行数:15,
示例6: SWriteGetPortAttributeReplystatic intSWriteGetPortAttributeReply( ClientPtr client, xvGetPortAttributeReply *rep){ char n; swaps(&rep->sequenceNumber, n); swapl(&rep->length, n); swapl(&rep->value, n); (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep); return Success;}
开发者ID:eriytt,项目名称:xserver-xsdl,代码行数:15,
示例7: reply_XIQueryDevice/* reply handling for the first bytes that constitute the reply */static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *userdata){ xXIQueryDeviceReply *rep = (xXIQueryDeviceReply*)data; struct test_data *querydata = (struct test_data*)userdata; if (client->swapped) { swapl(&rep->length); swaps(&rep->sequenceNumber); swaps(&rep->num_devices); } reply_check_defaults(rep, len, XIQueryDevice); if (querydata->which_device == XIAllDevices) assert(rep->num_devices == devices.num_devices); else if (querydata->which_device == XIAllMasterDevices) assert(rep->num_devices == devices.num_master_devices); else assert(rep->num_devices == 1); querydata->num_devices_in_reply = rep->num_devices; reply_handler = reply_XIQueryDevice_data;}
开发者ID:4eremuxa,项目名称:xserver,代码行数:25,
示例8: request_XISetClientPointerstatic voidrequest_XISetClientPointer(xXISetClientPointerReq * req, int error){ int rc; client_request = init_client(req->length, req); rc = ProcXISetClientPointer(&client_request); assert(rc == error); if (rc == BadDevice) assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; swapl(&req->win); swaps(&req->length); swaps(&req->deviceid); rc = SProcXISetClientPointer(&client_request); assert(rc == error); if (rc == BadDevice) assert(client_request.errorValue == req->deviceid);}
开发者ID:Agnesa,项目名称:xserver,代码行数:24,
示例9: mainint main(void){ printf("Here are some swaps: "); int x = GetInt(); int y = GetInt(); printf("%i", x); printf("%i", y); swaps(1, 2); printf("%i", x); printf("%i", y); }
开发者ID:benschac,项目名称:cs50,代码行数:15,
示例10: ProcXF86DRIQueryVersionstatic intProcXF86DRIQueryVersion( register ClientPtr client){ xXF86DRIQueryVersionReply rep; REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; rep.majorVersion = SERVER_XF86DRI_MAJOR_VERSION; rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION; rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); return Success;}
开发者ID:4eremuxa,项目名称:xserver,代码行数:24,
示例11: SwapDeviceInfostatic voidSwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info){ char n; char *any = (char*)&info[1]; int i; /* Skip over name */ any += pad_to_int32(info->name_len); for (i = 0; i < info->num_classes; i++) { int len = ((xXIAnyInfo*)any)->length; switch(((xXIAnyInfo*)any)->type) { case XIButtonClass: SwapButtonInfo(dev, (xXIButtonInfo*)any); break; case XIKeyClass: SwapKeyInfo(dev, (xXIKeyInfo*)any); break; case XIValuatorClass: SwapValuatorInfo(dev, (xXIValuatorInfo*)any); break; } any += len * 4; } swaps(&info->deviceid, n); swaps(&info->use, n); swaps(&info->attachment, n); swaps(&info->num_classes, n); swaps(&info->name_len, n);}
开发者ID:EMGD-Community,项目名称:xserver-xorg,代码行数:36,
示例12: SProcRRSetCrtcTransformstatic int _X_COLDSProcRRSetCrtcTransform(ClientPtr client){ int nparams; char *filter; CARD32 *params; REQUEST(xRRSetCrtcTransformReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq); swaps(&stuff->length); swapl(&stuff->crtc); SwapLongs((CARD32 *) &stuff->transform, bytes_to_int32(sizeof(xRenderTransform))); swaps(&stuff->nbytesFilter); filter = (char *) (stuff + 1); params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter)); nparams = ((CARD32 *) stuff + client->req_len) - params; if (nparams < 0) return BadLength; SwapLongs(params, nparams); return (*ProcRandrVector[stuff->randrReqType]) (client);}
开发者ID:mirror,项目名称:xserver,代码行数:24,
示例13: ProcSecurityQueryVersionstatic intProcSecurityQueryVersion( ClientPtr client){ /* REQUEST(xSecurityQueryVersionReq); */ xSecurityQueryVersionReply rep; REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION; rep.minorVersion = SERVER_SECURITY_MINOR_VERSION; if(client->swapped) { char n; swaps(&rep.sequenceNumber, n); swaps(&rep.majorVersion, n); swaps(&rep.minorVersion, n); } (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), (char *)&rep); return Success;} /* ProcSecurityQueryVersion */
开发者ID:OpenInkpot-archive,项目名称:iplinux-xorg-server,代码行数:24,
示例14: SProcLbxGetPropertystatic intSProcLbxGetProperty(ClientPtr client){ register int n; REQUEST(xLbxGetPropertyReq); swaps(&stuff->length, n); swapl(&stuff->window, n); swapl(&stuff->property, n); swapl(&stuff->type, n); swapl(&stuff->longOffset, n); swapl(&stuff->longLength, n); return ProcLbxGetProperty(client);}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:15,
示例15: SProcXChangeDeviceControlintSProcXChangeDeviceControl(ClientPtr client){ xDeviceCtl *ctl; REQUEST(xChangeDeviceControlReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); swaps(&stuff->control); ctl = (xDeviceCtl *) &stuff[1]; swaps(&ctl->control); swaps(&ctl->length); switch (stuff->control) { case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: case DEVICE_CORE: case DEVICE_ENABLE: case DEVICE_RESOLUTION: /* hmm. beer. *drool* */ break; } return (ProcXChangeDeviceControl(client));}
开发者ID:LeadHyperion,项目名称:RaspberryPiXServer,代码行数:24,
示例16: SDeviceLeaveNotifyEventstatic voidSDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to){ char n; *to = *from; swaps(&to->sequenceNumber,n); swapl(&to->length, n); swaps(&to->evtype, n); swaps(&to->deviceid, n); swapl(&to->time, n); swapl(&to->root, n); swapl(&to->event, n); swapl(&to->child, n); swapl(&to->root_x, n); swapl(&to->root_y, n); swapl(&to->event_x, n); swapl(&to->event_y, n); swaps(&to->sourceid, n); swaps(&to->buttons_len, n); swapl(&to->mods.base_mods, n); swapl(&to->mods.latched_mods, n); swapl(&to->mods.locked_mods, n);}
开发者ID:nikai3d,项目名称:xserver,代码行数:24,
示例17: request_XIQueryVersion/** * Run a single test with server version smaj.smin and client * version cmaj.cmin. Verify that return code is equal to 'error'. * * Test is run normal, then for a swapped client. */static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error){ char n; int rc; struct test_data versions; xXIQueryVersionReq request; ClientRec client; request_init(&request, XIQueryVersion); client = init_client(request.length, &request); userdata = (void*)&versions; /* Change the server to support smaj.smin */ XIVersion.major_version = smaj; XIVersion.minor_version = smin; /* remember versions we send and expect */ versions.major_client = cmaj; versions.minor_client = cmin; versions.major_server = XIVersion.major_version; versions.minor_server = XIVersion.minor_version; request.major_version = versions.major_client; request.minor_version = versions.minor_client; rc = ProcXIQueryVersion(&client); g_assert(rc == error); client.swapped = TRUE; swaps(&request.length, n); swaps(&request.major_version, n); swaps(&request.minor_version, n); rc = SProcXIQueryVersion(&client); g_assert(rc == error);}
开发者ID:Agnarr,项目名称:xserver,代码行数:42,
示例18: SProcXIPassiveUngrabDeviceint _X_COLDSProcXIPassiveUngrabDevice(ClientPtr client){ int i; uint32_t *modifiers; REQUEST(xXIPassiveUngrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); swaps(&stuff->length); swapl(&stuff->grab_window); swaps(&stuff->deviceid); swapl(&stuff->detail); swaps(&stuff->num_modifiers); REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq, ((uint32_t) stuff->num_modifiers) << 2); modifiers = (uint32_t *) &stuff[1]; for (i = 0; i < stuff->num_modifiers; i++, modifiers++) swapl(modifiers); return ProcXIPassiveUngrabDevice(client);}
开发者ID:jon-turney,项目名称:xorg-server,代码行数:24,
示例19: SDeviceStateNotifyEventstatic voidSDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to){ int i; char n; INT32 *ip B32; *to = *from; swaps(&to->sequenceNumber, n); swapl(&to->time, n); ip = &to->valuator0; for (i = 0; i < 3; i++) { swapl((ip + i), n); /* macro - braces are required */ }}
开发者ID:nikai3d,项目名称:xserver,代码行数:15,
示例20: XETSwChangeKeyboardMappingvoid XETSwChangeKeyboardMapping (register xChangeKeyboardMappingReq *data){ register char n; register long *p; register int i, count; swaps(&(data->length), n); p = (long *)&(data[1]); count = data->keyCodes * data->keySymsPerKeyCode; for(i = 0; i < count; i++) { swapl(p, n); p++; }}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:15,
示例21: XETSwSendEventvoid XETSwSendEvent(register xSendEventReq *data){ register char n; xEvent eventT; void (*proc)(); swapl(&(data->destination), n); swapl(&(data->eventMask), n); /* Swap event */ proc = EventSwapVector[data->event.u.u.type & 0177]; if (!proc || (int (*)()) proc == (int (*)()) NotImplemented) (*proc)(&(data->event), &eventT); data->event = eventT; swaps(&(data->length), n);}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:15,
示例22: SProcShmPutImagestatic intSProcShmPutImage(ClientPtr client){ int n; REQUEST(xShmPutImageReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xShmPutImageReq); swapl(&stuff->drawable, n); swapl(&stuff->gc, n); swaps(&stuff->totalWidth, n); swaps(&stuff->totalHeight, n); swaps(&stuff->srcX, n); swaps(&stuff->srcY, n); swaps(&stuff->srcWidth, n); swaps(&stuff->srcHeight, n); swaps(&stuff->dstX, n); swaps(&stuff->dstY, n); swapl(&stuff->shmseg, n); swapl(&stuff->offset, n); return ProcShmPutImage(client);}
开发者ID:Agnarr,项目名称:xserver,代码行数:21,
示例23: ProcEVIGetVisualInfostatic intProcEVIGetVisualInfo(ClientPtr client){ REQUEST(xEVIGetVisualInfoReq); xEVIGetVisualInfoReply rep; int i, n, n_conflict, n_info, sz_info, sz_conflict; VisualID32 *conflict; unsigned int total_visuals = 0; xExtendedVisualInfo *eviInfo; int status; /* * do this first, otherwise REQUEST_FIXED_SIZE can overflow. we assume * here that you don't have more than 2^32 visuals over all your screens; * this seems like a safe assumption. */ for (i = 0; i < screenInfo.numScreens; i++) total_visuals += screenInfo.screens[i]->numVisuals; if (stuff->n_visual > total_visuals) { return BadValue; } REQUEST_FIXED_SIZE(xEVIGetVisualInfoReq, stuff->n_visual * sz_VisualID32); status = eviPriv->getVisualInfo((VisualID32 *)&stuff[1], (int)stuff->n_visual, &eviInfo, &n_info, &conflict, &n_conflict); if (status != Success) return status; sz_info = n_info * sz_xExtendedVisualInfo; sz_conflict = n_conflict * sz_VisualID32; rep.type = X_Reply; rep.n_info = n_info; rep.n_conflicts = n_conflict; rep.sequenceNumber = client->sequence; rep.length = (sz_info + sz_conflict) >> 2; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); swapl(&rep.n_info, n); swapl(&rep.n_conflicts, n); swapEviInfo(eviInfo, n_info); swapVisual(conflict, n_conflict); } WriteToClient(client, sz_xEVIGetVisualInfoReply, (char *)&rep); WriteToClient(client, sz_info, (char *)eviInfo); WriteToClient(client, sz_conflict, (char *)conflict); eviPriv->freeVisualInfo(eviInfo, conflict); return (client->noClientException);}
开发者ID:dimkr,项目名称:tinyxserver,代码行数:48,
示例24: swapCharInfostatic voidswapCharInfo(xCharInfo * pCI){ swaps(&pCI->leftSideBearing); swaps(&pCI->rightSideBearing); swaps(&pCI->characterWidth); swaps(&pCI->ascent); swaps(&pCI->descent); swaps(&pCI->attributes);}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:10,
示例25: XETSwCopyAreavoid XETSwCopyArea(register xCopyAreaReq *data){ register char n; swaps(&(data->length), n); swapl(&(data->srcDrawable), n); swapl(&(data->dstDrawable), n); swapl(&(data->gc), n); swaps(&(data->srcX), n); swaps(&(data->srcY), n); swaps(&(data->dstX), n); swaps(&(data->dstY), n); swaps(&(data->width), n); swaps(&(data->height), n);}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:14,
示例26: SWriteQueryPortAttributesReplystatic intSWriteQueryPortAttributesReply( ClientPtr client, xvQueryPortAttributesReply *rep){ char n; swaps(&rep->sequenceNumber, n); swapl(&rep->length, n); swapl(&rep->num_attributes, n); swapl(&rep->text_size, n); (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep); return Success;}
开发者ID:eriytt,项目名称:xserver-xsdl,代码行数:16,
示例27: SProcStoreColorsintSProcStoreColors(ClientPtr client){ char n; long count; xColorItem *pItem; REQUEST(xStoreColorsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); swapl(&stuff->cmap, n); pItem = (xColorItem *) &stuff[1]; for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; ) SwapColorItem(pItem++); return((* ProcVector[X_StoreColors])(client));}
开发者ID:Agnarr,项目名称:xserver,代码行数:16,
示例28: ProcGEQueryVersionstatic intProcGEQueryVersion(ClientPtr client){ GEClientInfoPtr pGEClient = GEGetClient(client); xGEQueryVersionReply rep; REQUEST(xGEQueryVersionReq); REQUEST_SIZE_MATCH(xGEQueryVersionReq); rep = (xGEQueryVersionReply) { .repType = X_Reply, .RepType = X_GEQueryVersion, .sequenceNumber = client->sequence, .length = 0, /* return the supported version by the server */ .majorVersion = SERVER_GE_MAJOR_VERSION, .minorVersion = SERVER_GE_MINOR_VERSION }; /* Remember version the client requested */ pGEClient->major_version = stuff->majorVersion; pGEClient->minor_version = stuff->minorVersion; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xGEQueryVersionReply), &rep); return Success;}int (*ProcGEVector[GENumberRequests]) (ClientPtr) = { /* Version 1.0 */ProcGEQueryVersion};/************************************************************//* swapped request handlers *//************************************************************/static intSProcGEQueryVersion(ClientPtr client){ REQUEST(xGEQueryVersionReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGEQueryVersionReq); swaps(&stuff->majorVersion); swaps(&stuff->minorVersion); return (*ProcGEVector[stuff->ReqType]) (client);}
开发者ID:Distrotech,项目名称:xserver,代码行数:54,
示例29: SProcXkbSetGeometrystatic intSProcXkbSetGeometry(ClientPtr client){register int n; REQUEST(xkbSetGeometryReq); swaps(&stuff->length,n); REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); swaps(&stuff->deviceSpec,n); swapl(&stuff->name,n); swaps(&stuff->widthMM,n); swaps(&stuff->heightMM,n); swaps(&stuff->nProperties,n); swaps(&stuff->nColors,n); swaps(&stuff->nDoodads,n); swaps(&stuff->nKeyAliases,n); return ProcXkbSetGeometry(client);}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:19,
示例30: SProcRecolorCursorintSProcRecolorCursor (ClientPtr client){ char n; REQUEST(xRecolorCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xRecolorCursorReq); swapl(&stuff->cursor, n); swaps(&stuff->foreRed, n); swaps(&stuff->foreGreen, n); swaps(&stuff->foreBlue, n); swaps(&stuff->backRed, n); swaps(&stuff->backGreen, n); swaps(&stuff->backBlue, n); return((* ProcVector[X_RecolorCursor])(client));}
开发者ID:Agnarr,项目名称:xserver,代码行数:16,
注:本文中的swaps函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ sway_log函数代码示例 C++ swapl函数代码示例 |