печально быть антисоциальным - //c++ sux

Jan. 7th, 2004

06:01 pm - //c++ sux

Previous Entry Add to Memories Tell A Friend Next Entry

Kods strādā, vārdi mainīti. Neviens no kolēģiem, kas varētu iedomāties kautko tādu nokopēt, testus neskatās.

Mainīgo vārdi stuff, master un komentārs //c++ sux, paliks kodā, kamēr man neuzlabosies garastāvoklis un es nepārtaisīšu savādāk.




static void DaTest::dongledCopyThread(void* stuff);
void DaTest::magicCopyThread(void* stuff)
{
DaTest* master = (DaTest*) (((void**)stuff)[0]);
Mutex* mutex = (Mutex*) (((void**)stuff)[1]);
mutex->lock();
master->mtMagicCopyTest();
mutex->unlock();
}

TEST_METHOD(DaTest, magicCopyThreadTest)
Mutex* mutex = Threads::createMutex();
void* stuff[2] ;
stuff[0] = (void*) mutex;
stuff[1] = (void*) this;

Threads::startThread(magicCopyThread, stuff);
master->mtMagicCopyTest();
mutex->lock();
mutex->unlock();
}

(10 comments | Leave a comment)

Comments:

[User Picture]
From:[info]kemune
Date:January 7th, 2004 - 07:19 pm
(Link)
sux C++ tā izmantot
(Reply to this)
From:[info]mulders
Date:January 8th, 2004 - 09:13 am
(Link)
da metiet pie malas to C++ gudriishi blja atradushies!

taa vietaa lai raxtiitu logjiku taisa magjiju ar pointeriem - atshauties tak var!

nee toch C++ sux ij liidz shim briidim - a vedj ar kompjiem jau 16 gadus njemos, neiru iemaaciijies sho dikti diivaino valodu ij man ir aizdomas ka nekad arii neiemaaciishos, ja vien par to man nesaax maxaat 2x lielaaku algu kaa tagad!
(Reply to this) (Thread)
(no subject) - [info]agronoms
[User Picture]
From:[info]smejmoon
Date:January 9th, 2004 - 11:41 am
(Link)
a es tur loģiku rakstu. tikai vienīgais veids, kā nodot datus man ir void* :(
(Reply to this) (Parent)
From:[info]grrr
Date:January 8th, 2004 - 09:31 am
(Link)
Skatoties uz šādu kodu, neviļus nāk prātā,
cik apbrīnojami atbilstoši labskanīgs ir vārds "obfuscated". Nu kā vēl savādāk to nosauksi?
(Reply to this)
[User Picture]
From:[info]mao
Date:January 8th, 2004 - 02:32 pm
(Link)
chau dejojoshais dervish,
spelju automati
shodien garam,
zinibu kaltuvee
pedejie speeki

vot!
(Reply to this)
From:(Anonymous)
Date:January 8th, 2004 - 03:59 pm

c++ kruts?

(Link)
Izskataas, ka vienaa vietaa ieksh 'stuff' tiek sabaazts 'mutex' un 'this' kaa 0. un 1. elementi, bet otraa vietaa njemti aaraa otraadaa seciibaa?

Vai statiskie c++ koda kompilatori ir peekshnji kljuvushi tik kruti, ka neliekot #pragma DWIM tas kods straada?
(Reply to this) (Thread)
[User Picture]
From:[info]smejmoon
Date:January 9th, 2004 - 11:40 am

Re: c++ kruts?

(Link)
mea culpa
(Reply to this) (Parent)
From:[info]socrates
Date:January 9th, 2004 - 12:13 am
(Link)
i kur tu TEST_METHOD 'master' mainīgo rāvi, tač ne no zila gaisa?
(Reply to this) (Thread)
[User Picture]
From:[info]smejmoon
Date:January 9th, 2004 - 11:40 am
(Link)
this
(Reply to this) (Parent)