这篇教程C++ ushort函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ushort函数的典型用法代码示例。如果您正苦于以下问题:C++ ushort函数的具体用法?C++ ushort怎么用?C++ ushort使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ushort函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: qPixmapSerial// hacky but faster version of "QString::sprintf("%d-%d", i, enabled)"static QString qPixmapSerial(quint64 i, bool enabled){ ushort arr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', ushort('0' + enabled) }; ushort *ptr = &arr[16]; while (i > 0) { // hey - it's our internal representation, so use the ascii character after '9' // instead of 'a' for hex *(--ptr) = '0' + i % 16; i >>= 4; } return QString((const QChar *)ptr, int(&arr[sizeof(arr) / sizeof(ushort)] - ptr));}
开发者ID:cdaffara,项目名称:symbiandump-mw3,代码行数:15,
示例2: DivideTwo// делит a на b, при учёте, что b*MAX_ELEM >=aushort DivideTwo( TrueLong& a, TrueLong& b ){ if( a.IsZero() ) return 0; if( b.IsZero() ) return 0; ushort min = 0, cur = ushort(LIMIT >> 1); ulong max = LIMIT; TrueLong c; for( ; (max-min) > 1; cur = ushort((max+min)/2) ) { c = b; c *= cur; if( c <= a ) min = cur; else max = cur; } return min;}
开发者ID:lxmzhv,项目名称:starfight,代码行数:16,
示例3: saveBrushToImage void saveBrushToImage(const Brush& brush, Image& image) { // save brush as a 16bit grayscale image#if OGRE_VERSION_MINOR > 4 ushort* data = (ushort*)OGRE_ALLOC_T(uchar, brush.getWidth()*brush.getHeight()*sizeof(ushort), MEMCATEGORY_GENERAL);#else ushort* data = (ushort*)new uchar[brush.getWidth()*brush.getHeight()*sizeof(ushort)];#endif for (size_t x = 0; x < brush.getWidth(); ++x) for (size_t y = 0; y < brush.getHeight(); ++y) data[y*brush.getWidth() + x] = ushort(brush.at(x, y) * 0xffff); // pass the data to the image, image takes over ownership image.loadDynamicImage((uchar*)data, brush.getWidth(), brush.getHeight(), 1, PF_L16, true); }
开发者ID:oksangman,项目名称:Ant,代码行数:15,
示例4: OutVarNameValstatic void OutVarNameVal(op_t &x){ushort addr = ushort(x.value);ea_t toea = toEA(codeSeg(addr,x.n), addr);#if IDP_INTERFACE_VERSION > 37 if ( out_name_expr(x,toea,addr) )return;#else const char *ptr; if ( (ptr=get_name_expr(cmd.ea+x.offb, toea, addr)) != NULL ){ //вывод имен переменных и меток перехода OutLine(ptr); }#endifelse OutValue(x, OOFW_16);}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:15,
|