- 1
clEnqueueReleaseGLObjects(queue, objects.size(), objects.data(), 9, NULL, NULL);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+11
clEnqueueReleaseGLObjects(queue, objects.size(), objects.data(), 9, NULL, NULL);
В целом ничего страшного, но почему на клавиатуре девятка так рядом с нулём?
+28
std::size_t _;
std:size_t __;
http://ideone.com/Ie1AY
+20
#include <iostream>
#include <string>
#include <stdio.h>
#include <time.h>
int main()
{
time_t now = time(0);
struct tm tstruct = *localtime(&now);
if (tstruct.tm_yday & 0xff) {
std::cout << "Pasony, segodnja den' programmista!"<< std::endl;
} else {
/*Syscall platform dependent implementation */
//KeepCoding();
}
return 0;
}
ВНЕЗАПНО: http://tinyurl.com/c8kkxl8
+35
// стоит простая задача: удалить все узлы из списка
// чувак думает, как же ему это реализовать через задницу?
// и получилось же!
if (link * root = list.get_root()) {
link * next;
do {
next = root->next();
list.remove(next);
} while (root = next);
}
// неужели нельзя вот так, по-простому?
link * node = list.get_root();
while (node) {
link * next = node->next();
list.remove(node);
node = next;
}
+22
string toString( int i ) {
stringstream s;
s << i;
return s.str();
}
Наткнулся на эту функцию в одном из своих старых проектом.
+29
string input;
string output;
input = "C:\\bla.txt\\"; //"Bla.txt" is the file to copy
output = "C:\\test\\"; //"Test" is the folder to copy to
system("copy input.c_str() output.c_str()")
http://cboard.cprogramming.com/cplusplus-programming/109047-help-copy-files-cplusplus.html
+18
char* GetConnectionName(){return "";}
//---
char* NetworkMgr::getErrorString(int id)
{
if(this->idValid(id))
{
return errors[id];
}
else
{
return "!!!unknown error!!!";
}
}
Из тела одного большого класса, я конечно понимаю что строки хранятся не в стеке, но всеравно.
+45
Matrix::~Matrix()
{
data = NULL;
delete [] data;
};
no comments
+82
bool isOperator( char c ) {
return c == '+'
|| c == '-'
|| c == '*'
|| c == '/'
|| c == '('
|| c == ')';
}
+17
char stmt[1024];
int offset = 0;
// ...
for ( int count = 1 ; ; )
{
offset += sprintf(stmt + offset , "$%d" , count);
count ++;
if ( count > p_max )
{
break;
}
offset += sprintf(stmt + offset , ",");
}
Сборка строки вида "$1,$2,$3,$4" для запроса к PostgreSQL.
Q: Где здесь с++, bormand?
A: Проект написан на с++.