- 1
 
reinterpret_cast<ppu_function_t>(static_cast<std::uintptr_t>(ppu_ref<u32>(cia)))(*this);
                                    Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 23
0
reinterpret_cast<ppu_function_t>(static_cast<std::uintptr_t>(ppu_ref<u32>(cia)))(*this);
                                    
            Лопни глазоньки. Шаблоны увечат С++ как бог черепаху.
https://github.com/RPCS3/rpcs3/blob/91d06a97296e5e418fb601284577475d8c7dfbaf/rpcs3/Emu/Cell/PPUThread.cpp
        
+2
#include <conio.h>
static unsigned char bigArray[256] = {['0'] = 0, ['1'] = 1, ['2'] = 2, ['3'] = 3,
                                      ['4'] = 4, ['5'] = 5, ['6'] = 6, ['7'] = 7,
                                      ['8'] = 8, ['9'] = 9, ['A'] = 10, ['B'] = 11,
                                      ['C'] = 12, ['D'] = 13, ['E'] = 14, ['F'] = 15 };
void StringToByte(const char src[], unsigned char dst[]) 
{
	int q, u = 0;
	for (q = 0; src[q]; q+=2) 
	{
		dst[u] = bigArray[src[q]] << 4;
		if (!src[q+1]) 
			return;
		dst[u++] |= bigArray[src[q+1]];
	}
}
int main()
{
	char string[] = "112255ACBF";
	unsigned char bytes[5];
	StringToByte(string, bytes);
	int i;
	for (i = 0; i!=sizeof(bytes); i++)
		printf("%x ", (int)bytes[i]);
	return 0;
}
                                    Ебическая С-ла.
−1
#include <stdio.h>
#include <inttypes.h> 
int main(void) {
	float a = 0;
	float b = -9.8 * 0;
	uint32_t* pa = (void*)&a;
	uint32_t* pb = (void*)&b;
	printf("%li %li %i %f %f\n",pa[0] , pb[0], pb[0]>>31, b+0, b);
	return 0;
}
                                    Нолик со взведенным знаковым битом. Вот зачем он нужен?
−1
#include <iostream>
#include <string>
#include <sstream>
#include <string.h>
#include <stdlib.h>
typedef std::ios_base& sibr;
typedef sibr (*StringType)(sibr);
int atoi_hod(const char a[], short int *offset) 
{
	short int numtype = (a[0]== '0')+((a[1]=='x')||(a[1]=='X'));
    StringType st;
    *offset = 0;
    while(a[*offset]&&a[*offset]!='.') (*offset)=(*offset)+1;
    switch (numtype)
    {
		case 0:
		  st = std::dec;
		break;
		case 1:
		  st = std::oct;
		break;
		case 2:
		  st = std::hex;
		break;		
	}
    int u;
    std::istringstream(a)>>st>>u;    
	return u;
}
bool isIpv4String(const std::string &str)
{
	size_t size = str.length();
	bool result = size!=0;
	if(result)
	{
		const char *c_str = str.c_str();
		unsigned long int i = 0;
		char sym;
		do
		{
			sym = c_str[i++];
			result = sym=='.'||(sym>='0'&&sym<='9')||!sym||(sym>='a'&&sym<='f')||(sym>='A'&&sym<='F')||sym=='x'||sym=='X';
				
		}
		while (sym&&result);
		i = 0;
		short int dotsOrTerm = 0, numbers = 0, offset; 
		while (result&&i<size) 
		{
			int n = atoi_hod(&c_str[i], &offset);
			result = n<256;
			numbers += result; 
			i += offset;
			result = result&&(c_str[i]=='.'||!c_str[i]);
			i+=result;
			dotsOrTerm += result; 			
		}
		result = (dotsOrTerm == 4)&&(numbers == 4);		
	}
	return result;
}
int main() 
{
	std::string adress;
	std::cin>>adress;
	std::cout<<(isIpv4String(adress)?"TRUE":"FALSE")<<std::endl;
	return 0;
}
                                    По мотивам ГК #24055, наконец-то руки дошли.
0
char bytes[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
function1(bytes);
(void)(bytes[0] = 10), (void)(bytes[1] = 11), (void)(bytes[2] = 12); //WTF?
function2(bytes);
                                    
            Вот такую байду требует написать XCode при присвоении элементов массива через запятую, иначе warning.
Гейкорп и их главпидор Кук совсем охренели, мало того что последие хуйкоды крашатся и виснут по фазам луны, мало того что встроенный гуй систем контроля версий работает как говно, так оно еще и ворининги выдает на ровном месте - качество apple - blyad.
        
−16
void WaitCompletionProcesses(const std::vector<void*>* ProcessHandles)
{
	int count = ProcessHandles->size();
	std::vector<void*> buffer = ProcessHandles[0];
	std::vector<void*> running;
	unsigned long int retcode;
	void* handle;
	do
	{
		for(int i = 0; i!=count; i++)
		{
			handle = buffer[i];
			GetExitCodeProcess(handle, &retcode);
			if(retcode==259)
				running.push_back(handle);
		}
		count = running.size();
		buffer = running;
		running.clear();
	}
	while(count);
}
                                    Пишу на досуге одну приблуду для IDE Geany, проблема в том что процессы компиляции асинхронны процессу моей программы, в результате команду на запуск компилятора я дал, но линкер часто хватается за недокомпиленые обектники, как результат ошибка. Нужно ждать пока отработают компиляторы, а потом кидать на линковку - я пока налобал такое, оно еще и работает, но как поступили господа белые.
−390
openUTButton.frame = CGRectMake(SCREEN_WIDTH - (IS_IPAD ? 225. : 120.) - (IS_IPAD ? 40. : 20),
                                        IS_IPAD ? 40. : 20.,
                                        IS_IPAD ? 225 : 120.,
                                        IS_IPAD ? 60. : 35.);
                                    И так для каждого элемента интерфейса и каждый раз при смене ориентации - просто тернарный фетишизм.
−393
- (void)config
{
    self.contentView.backgroundColor = [UIColor NaviCellBgColor];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    UIImageView *theDisclosureView = _disclosureView;
    UILabel *theLabel = _titleLabel;
    if (self.isHighlighted)
    {
        theLabel.shadowColor = [UIColor TextShadowColor];
        theLabel.shadowOffset = CGSizeMake(0.0f, -0.5f);
        self.contentView.backgroundColor = [UIColor NaviCellBgHighlightColor];
        theLabel.textColor = [UIColor GreenTextColor];
        self.contentView.backgroundColor = [UIColor NaviCellBgHighlightColor];
        theDisclosureView.image = [UIImage imageNamed:@"Button_Disclosure_touch"];
    }
    else
    {
        theLabel.shadowColor = [UIColor TextShadowColor];
        theLabel.shadowOffset = CGSizeMake(0.0f, -0.5f);
        self.contentView.backgroundColor = [UIColor NaviCellBgHighlightColor];
        theLabel.textColor = [UIColor GreenTextColor];
        self.contentView.backgroundColor = [UIColor NaviCellBgColor];
        theDisclosureView.image = [UIImage imageNamed:@"Button_Disclosure"];
    }
    UIActivityIndicatorView *theIndicator = _loadingIndicator;
    if (_loading)
        [theIndicator startAnimating];
    else
        [theIndicator stopAnimating];
    
    UILabel *theTitleLabel = _titleLabel;
    theTitleLabel.textColor = [UIColor GreenTextColor];
}
                                    Код вид культурного европэйця. Справжний европейский кодстайл.
−402
UIDevice* thisDevice = [UIDevice currentDevice];
    char cfunktion[] = {'u', 'n', 'i', 'q', 'u', 'e', 'I', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r',0};
    SEL udid = NSSelectorFromString([NSString stringWithUTF8String:cfunktion]);
    id identifier =[thisDevice performSelector:udid];
                                    Безпалевно вызываем скрытые апи.
+57
#include <string>
std::string SearchPushString(char StartVkPage[])
{
	char push[] = {'p','o', 's', 't'};
	char http[] = {'h','t', 't', 'p'};
	unsigned int* ipush = (unsigned int*)push;
	unsigned long j = 0;
	do
	{
		char* p = &StartVkPage[j];
		unsigned int* nextFourSymbol = (unsigned int*)p;
		if(nextFourSymbol[0]==ipush[0])
		{
			if(*p=='p')
				ipush = (unsigned int*)http;
			else
			{
				char* postString = new char[650];
				memset(postString,0,650);
				short int u = 0;
				do
				{
					postString[u] = p[u];
				}
				while(p[++u]!='"'&&u!=650);
				std::string url(postString);
				delete [] postString;
				return url;
			}
		}		
	}
	while(StartVkPage[j++]);
	return std::string("error");
}
                                    Я все никак не выучу регулярных выражений, ИЧСХ - обхожусь.