• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OSSwapInt32函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OSSwapInt32

struct load_command *doloadcommand(void *start, struct load_command *lc, bool needsFlip, bool is32, struct gcinfo *gcip) {
    if (needsFlip) {
        lc->cmd = OSSwapInt32(lc->cmd);
        lc->cmdsize = OSSwapInt32(lc->cmdsize);
    }

    switch(lc->cmd) {
    case LC_SEGMENT_64:
	if (debug) printf("...segment64\n");
        if (is32) printf("XXX we have a 64-bit segment in a 32-bit mach-o\n");
        doseg64(start, (struct segment_command_64 *)lc, needsFlip, gcip);
        break;
    case LC_SEGMENT:
	if (debug) printf("...segment32\n");
        doseg32(start, (struct segment_command *)lc, needsFlip, gcip);
        break;
    case LC_SYMTAB: if (debug) printf("...dynamic symtab\n"); break;
    case LC_DYSYMTAB: if (debug) printf("...symtab\n"); break;
    case LC_LOAD_DYLIB:
        dodylib(start, (struct dylib_command *)lc, needsFlip);
        break;
    case LC_SUB_UMBRELLA: if (debug) printf("...load subumbrella\n"); break;
    default:    if (debug) printf("cmd is %x\n", lc->cmd); break;
    }
    
    return (struct load_command *)((void *)lc + lc->cmdsize);
}
开发者ID:prototype,项目名称:MacRuby,代码行数:27,代码来源:markgc.c


示例2: IOLog

IOReturn SamplePCIUserClientClassName::method1(
    UInt32 * dataIn, UInt32 * dataOut,
    IOByteCount inputSize, IOByteCount * outputSize )
{
    IOReturn	ret;
    IOItemCount	count;

    IOLog("SamplePCIUserClient::method1(");

    if (*outputSize < inputSize)
        return( kIOReturnNoSpace );

    count = inputSize / sizeof( UInt32 );
    for (UInt32 i = 0; i < count; i++ ) {
        // Client app is running using Rosetta
        if (fCrossEndian) {
            dataIn[i] = OSSwapInt32(dataIn[i]);
        }
        IOLog("" UInt32_x_FORMAT ", ", dataIn[i]);
        dataOut[i] = dataIn[i] ^ 0xffffffff;
        // Rosetta again
        if (fCrossEndian) {
            dataOut[i] = OSSwapInt32(dataOut[i]);
        }

    }

    ret = kIOReturnSuccess;
    IOLog(")\n");
    *outputSize = count * sizeof( UInt32 );

    return( ret );
}
开发者ID:kuolei,项目名称:CocoaSampleCode,代码行数:33,代码来源:AppleSamplePCIUserClient.cpp


示例3: swap_thread_command

void
swap_thread_command(
struct thread_command *ut,
enum NXByteOrder target_byte_sex)
{
	ut->cmd = OSSwapInt32(ut->cmd);
	ut->cmdsize = OSSwapInt32(ut->cmdsize);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:8,代码来源:swap.c


示例4: swap_x86_state_hdr

void
swap_x86_state_hdr(
x86_state_hdr_t *hdr,
enum NXByteOrder target_byte_sex)
{
	hdr->flavor = OSSwapInt32(hdr->flavor);
	hdr->count = OSSwapInt32(hdr->count);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:8,代码来源:i386_swap.c


示例5: swap_uuid_command

void
swap_uuid_command(
struct uuid_command *uuid_cmd,
enum NXByteOrder target_byte_sex)
{
	uuid_cmd->cmd = OSSwapInt32(uuid_cmd->cmd);
	uuid_cmd->cmdsize = OSSwapInt32(uuid_cmd->cmdsize);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:8,代码来源:swap.c


示例6: swap_fat_header

void
swap_fat_header(
struct fat_header *fat_header,
enum NXByteOrder target_byte_sex)
{
	fat_header->magic     = OSSwapInt32(fat_header->magic);
	fat_header->nfat_arch = OSSwapInt32(fat_header->nfat_arch);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:8,代码来源:swap.c


示例7: swap_ident_command

void
swap_ident_command(
struct ident_command *id_cmd,
enum NXByteOrder target_byte_sex)
{
	id_cmd->cmd = OSSwapInt32(id_cmd->cmd);
	id_cmd->cmdsize = OSSwapInt32(id_cmd->cmdsize);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:8,代码来源:swap.c


示例8: swap_load_command

void
swap_load_command(
struct load_command *lc,
enum NXByteOrder target_byte_sex)
{
	lc->cmd = OSSwapInt32(lc->cmd);
	lc->cmdsize = OSSwapInt32(lc->cmdsize);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:8,代码来源:swap.c


示例9: swap_sub_client_command

void
swap_sub_client_command(
struct sub_client_command *csub,
enum NXByteOrder target_byte_sex)
{
	csub->cmd = OSSwapInt32(csub->cmd);
	csub->cmdsize = OSSwapInt32(csub->cmdsize);
	csub->client.offset = OSSwapInt32(csub->client.offset);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:swap.c


示例10: swap_sub_library_command

void
swap_sub_library_command(
struct sub_library_command *lsub,
enum NXByteOrder target_byte_sex)
{
	lsub->cmd = OSSwapInt32(lsub->cmd);
	lsub->cmdsize = OSSwapInt32(lsub->cmdsize);
	lsub->sub_library.offset = OSSwapInt32(lsub->sub_library.offset);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:swap.c


示例11: swap_sub_umbrella_command

void
swap_sub_umbrella_command(
struct sub_umbrella_command *usub,
enum NXByteOrder target_byte_sex)
{
	usub->cmd = OSSwapInt32(usub->cmd);
	usub->cmdsize = OSSwapInt32(usub->cmdsize);
	usub->sub_umbrella.offset = OSSwapInt32(usub->sub_umbrella.offset);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:swap.c


示例12: swap_sub_framework_command

void
swap_sub_framework_command(
struct sub_framework_command *sub,
enum NXByteOrder target_byte_sex)
{
	sub->cmd = OSSwapInt32(sub->cmd);
	sub->cmdsize = OSSwapInt32(sub->cmdsize);
	sub->umbrella.offset = OSSwapInt32(sub->umbrella.offset);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:swap.c


示例13: swap_dylinker_command

void
swap_dylinker_command(
struct dylinker_command *dyld,
enum NXByteOrder target_byte_sex)
{
	dyld->cmd = OSSwapInt32(dyld->cmd);
	dyld->cmdsize = OSSwapInt32(dyld->cmdsize);
	dyld->name.offset = OSSwapInt32(dyld->name.offset);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:swap.c


示例14: swap_prebind_cksum_command

void
swap_prebind_cksum_command(
struct prebind_cksum_command *cksum_cmd,
enum NXByteOrder target_byte_sex)
{
	cksum_cmd->cmd = OSSwapInt32(cksum_cmd->cmd);
	cksum_cmd->cmdsize = OSSwapInt32(cksum_cmd->cmdsize);
	cksum_cmd->cksum = OSSwapInt32(cksum_cmd->cksum);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:swap.c


示例15: swap_i386_exception_state

void
swap_i386_exception_state(
i386_exception_state_t *exc,
enum NXByteOrder target_byte_sex)
{
	exc->trapno = OSSwapInt32(exc->trapno);
	exc->err = OSSwapInt32(exc->err);
    	exc->faultvaddr = OSSwapInt32(exc->faultvaddr);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:9,代码来源:i386_swap.c


示例16: swap_symseg_command

void
swap_symseg_command(
struct symseg_command *ss,
enum NXByteOrder target_byte_sex)
{
	ss->cmd = OSSwapInt32(ss->cmd);
	ss->cmdsize = OSSwapInt32(ss->cmdsize);
	ss->offset = OSSwapInt32(ss->offset);
	ss->size = OSSwapInt32(ss->size);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:10,代码来源:swap.c


示例17: swap_fvmfile_command

void
swap_fvmfile_command(
struct fvmfile_command *ff,
enum NXByteOrder target_byte_sex)
{
	ff->cmd = OSSwapInt32(ff->cmd);
	ff->cmdsize = OSSwapInt32(ff->cmdsize);
	ff->name.offset = OSSwapInt32(ff->name.offset);
	ff->header_addr = OSSwapInt32(ff->header_addr);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:10,代码来源:swap.c


示例18: swap_fvmlib_command

void
swap_fvmlib_command(
struct fvmlib_command *fl,
enum NXByteOrder target_byte_sex)
{
	fl->cmd = OSSwapInt32(fl->cmd);
	fl->cmdsize = OSSwapInt32(fl->cmdsize);
	fl->fvmlib.name.offset = OSSwapInt32(fl->fvmlib.name.offset);
	fl->fvmlib.minor_version = OSSwapInt32(fl->fvmlib.minor_version);
	fl->fvmlib.header_addr = OSSwapInt32(fl->fvmlib.header_addr);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:11,代码来源:swap.c


示例19: swap_prebound_dylib_command

void
swap_prebound_dylib_command(
struct prebound_dylib_command *pbdylib,
enum NXByteOrder target_byte_sex)
{
	pbdylib->cmd = OSSwapInt32(pbdylib->cmd);
	pbdylib->cmdsize = OSSwapInt32(pbdylib->cmdsize);
	pbdylib->name.offset = OSSwapInt32(pbdylib->name.offset);
	pbdylib->nmodules = OSSwapInt32(pbdylib->nmodules);
	pbdylib->linked_modules.offset =
		OSSwapInt32(pbdylib->linked_modules.offset);
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:12,代码来源:swap.c


示例20: swap_dylib_table_of_contents

void
swap_dylib_table_of_contents(
struct dylib_table_of_contents *tocs,
uint32_t ntocs,
enum NXByteOrder target_byte_sex)
{
    uint32_t i;

	for(i = 0; i < ntocs; i++){
	    tocs[i].symbol_index = OSSwapInt32(tocs[i].symbol_index);
	    tocs[i].module_index = OSSwapInt32(tocs[i].module_index);
	}
}
开发者ID:Apple-FOSS-Mirror,项目名称:cctools,代码行数:13,代码来源:swap.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OSTaskCreateExt函数代码示例发布时间:2022-05-30
下一篇:
C++ OSStart函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap