- 1
- 2
if (channel->leftover < 0) // if nothing left over for next time:
printk("ERRRRRRRRRRRRRRRRRRRRRRRRRRRR\n");
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+134
if (channel->leftover < 0) // if nothing left over for next time:
printk("ERRRRRRRRRRRRRRRRRRRRRRRRRRRR\n");
RRRRRRRRRRRRRRetard.
+136
struct hostent *rc_gethostbyname(const char *hostname)
{
struct hostent *hp;
#ifdef GETHOSTBYNAME_R
#if defined (GETHOSTBYNAMERSTYLE_SYSV) || defined (GETHOSTBYNAMERSTYLE_GNU)
struct hostent hostbuf;
size_t hostbuflen;
char *tmphostbuf;
int res;
int herr;
hostbuflen = 1024;
tmphostbuf = malloc(hostbuflen);
#endif
#endif
#ifdef GETHOSTBYNAME_R
#if defined (GETHOSTBYNAMERSTYLE_GNU)
while ((res = gethostbyname_r(hostname, &hostbuf, tmphostbuf, hostbuflen, &hp, &herr)) == ERANGE)
{
/* Enlarge the buffer */
hostbuflen *= 2;
tmphostbuf = realloc(tmphostbuf, hostbuflen);
}
free(tmphostbuf);
#elif defined (GETHOSTBYNAMERSTYLE_SYSV)
hp = gethostbyname_r(hostname, &hostbuf, tmphostbuf, hostbuflen, &herr);
free(tmphostbuf);
#else
hp = gethostbyname(hostname);
#endif
#else
hp = gethostbyname(hostname);
#endif
if (hp == NULL) {
return NULL;
}
return hp;
}
freeradius-client 1.1.6, казалось бы серьезная либа... Говно мамонта, конечно, но оно валяется в репе бубунты 14.10... Неужели никто еще не заметил? :)
+138
if (!GL_TRUE == linkStatus)
пример из vuforia sdk
вроде подобного булшита еще не было
+143
void ** __attribute__((noinline)) findVoidSortMap(void ** list,void *key)
{
if (!list) return 0;
if (!*list) return 0;
unsigned int count= **(unsigned int**)list;
char *p=(char*)*list;
p+=4;
Element *b=(Element *)p;
long long skey=(long long)key;
while (count>0) {
void** kt=(void**)&b[count>>1];
long long rkey=(long long)kt[0];
if (skey==rkey) return (void**)&kt[1];
if (skey>rkey) {b+=(count>>1)+1;count--;}
count=count>>1;
}
return (void**)-1;
}
гуру осемблира на этом коде доказывал, что Эльбрус сосёт
http://www.gamedev.ru/flame/forum/?id=196722&page=33#m481
+135
/*
* Lack of time prevents me from writing this segment properly.
* May Krishna have mercy on my soul.
*/
static const uint32_t pal = 720 * 576 * 2;
static const uint32_t ntsc_composite = 720 * 507 * 2;
static const uint32_t ntsc_sdi = 720 * 480 * 2;
uint16_t new_width = width, new_height = height;
if (height == 0) {
new_width = 1920;
new_height = 1080;
}
if (format == PAL) {
rv = pal;
memset(out_payload, 0x3F, rv);
}
else if (format == NTSC) {
if (source == SDI_VIDEO) {
rv = ntsc_sdi;
memset(out_payload, 0x3F, rv);
}
else {
rv = ntsc_composite;
memset(out_payload, 0x3F, rv);
}
}
else {
rv = new_width * new_height * 2;
memset(out_payload, 0x3F, rv);
}
Вот что переизбыток мочи делает.
+142
return (guint)(((double)(((double)((SAMPLERATE_48KHZ)) / (((double)(fps_numerator) / (double)(fps_denominator)))))));
Фу, блять.
+143
sprintf(path, "/usr/local/something/something_else_%d_%d.uyvy%c", some_int, some_other_int, '\0');
Мда-с.
+141
date = j / 86400l;
t = j - (date * 86400l);
date += 731000ul;
y = (4 * date - 1) / 146097;
d = (4 * date - 1 - 146097 * y) / 4;
date = (4 * d + 3) / 1461;
d = (4 * d + 7 - 1461 * date) / 4;
m = (5 * d - 3) / 153;
d = (5 * d + 2 - 153 * m) / 5;
y = 100 * y + date;
if (m < 10) {
m += 3;
} else {
m -= 9;
y++;
}
Voodoo magic...
+139
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
Совместимость
+140
HIMAGELIST ImageList_LoadImageV(PVOID ImageBase, PCWSTR a[], int level)
{
PIMAGE_RESOURCE_DATA_ENTRY pirde;
PBITMAPINFOHEADER pbih;
DWORD cx, cy, cb, n, ofs;
if (
0 <= LdrFindResource_U(ImageBase, a, level, &pirde) &&
0 <= LdrAccessResource(ImageBase, pirde, (void**)&pbih, &cb) &&
cb > sizeof(BITMAPINFOHEADER) &&
pbih->biSize >= sizeof(BITMAPINFOHEADER) &&
(cx = pbih->biWidth) <= (cy = pbih->biHeight) &&
!(cy % cx) &&
pbih->biBitCount == 32 &&
(ofs = pbih->biSize) + (cx * cy << 2) == cb
)
{
n = cy / cx, cb = cx * cx << 2;
if (HIMAGELIST himl = ImageList_Create(cx, cy, ILC_COLOR32, n, 0))
{
BITMAPINFO bi = { {sizeof(BITMAPINFOHEADER), cx, cx, 1, 32 } };
if (HDC hdc = GetDC(0))
{
if (HBITMAP hbmp = CreateCompatibleBitmap(hdc, cx, cx))
{
do ; while (
SetDIBits(hdc, hbmp, 0, cx, RtlOffsetToPointer(pbih, ofs), &bi, DIB_RGB_COLORS) &&
0 <= ImageList_Add(himl, hbmp, 0) &&
(ofs += cb, --n)
);
DeleteObject(hbmp);
}
ReleaseDC(0, hdc);
}
if (!n) return himl;
ImageList_Destroy(himl);
}
}
return 0;
}