Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What Can This Function Possibly Do?

Name: Anonymous 2011-09-28 5:17

I'm all lost...

libEntity *__cdecl cyLibDataEntry254(libEntity *E, entityPair *P)
{
  libEntity *L; // edx@1
  libEntity *Result; // eax@5
  libEntity *R; // edx@7

  L = E->L;
  if ( L )
  {
    L->R = E->R;
again:
    R = E->R;
    if ( R )
    {
      Result = E->L;
      R->L = Result;
    }
    else
    {
      if ( P->R != E )
        debugfail(254, "cglib/src/cylibdataentry.cpp");
      Result = E->L;
      P->R = Result;
    }
    E->L = 0;
    E->R = 0;
    return Result;
  }
  if ( P->L == E )
  {
    P->L = E->R;
    goto again;
  }
  if ( E->R )
    debugfail(243, "cglib/src/cylibdataentry.cpp");
  return Result;
}

Name: Anonymous 2011-09-28 5:18

fuck off fag

Name: Anonymous 2011-09-28 5:19

DON'T HELP HIM!!!

Name: Anonymous 2011-09-28 5:20

>>2>>3
are you jewish?

Name: Anonymous 2011-09-28 5:23

>>4
Are you an moron! Take it to http://7chan.org/pr or Stack Overflow. /prog/ isn't some personal help hotline.

Name: Anonymous 2011-09-28 5:26

>>5
Just admit, you're a retard.

Name: Anonymous 2011-09-28 5:26

Just run a tracking table. Give this program a set of valid inputs and track the current state of each variable for each line of code. If you can't figure it out after the first run, run it a couple more times for different types of input values.

I swear we learned this at 10th grade.

Name: Anonymous 2011-09-28 5:27

>>6
Say the person who cannot figure out a simple function.

Name: Anonymous 2011-09-28 5:27

>>5
Take it to http://7chan.org/pr
They already banned me, because they are jews.

Name: Anonymous 2011-09-28 5:28

>>8
define "simple"

Name: Anonymous 2011-09-28 5:29

>>7
Cant do this, till I decompile entire database code of the game. It's pretty big

Name: Anonymous 2011-09-28 5:31

OP are you russian?

Name: Anonymous 2011-09-28 5:35

>>9
They already banned me, because they are jews.
Most likely because your request was shitty even below their standards.

Name: Anonymous 2011-09-28 5:37

>>11
A small snippet like this surely serves a larger function in a program as big as a game. Even if you figure out what exactly this one function does, you may not understand the use of this part - just like understanding how one cog works in a large machine won't let you understand the machine. You need to understand the cog's purpose - where it is used. When does the program calls this function? What does it returns to the calling function? What other factions does it interacts with? All of these are important questions that need to be answered to figure out the true nature of a piece of code.

For a start, I am not entirely sure why you cannot simply do some guesswork and give this program a number of different inputs that it will accept, seeing if you recognize any pattern. This could give you the lead you need.

Name: Anonymous 2011-09-28 5:37

>>13
define "standards", jew.

Name: Anonymous 2011-09-28 5:40

>>14
But it looks a like a simple tree or linked list code. I immidiately recognized the binary tree search algorithm, but this place does some circular linking (looped lists), so I became lost.

Name: Anonymous 2011-09-28 5:40

>>15
You aren't a particularly good troll.

Name: Anonymous 2011-09-28 5:43

>>17
I'm not a troll. Imagine, you have cosine function and have no clue about "calculus", how can you determine it's purpose by simple blackbox testing?

Name: Anonymous 2011-09-28 5:48

>>18
and have no clue about "calculus"
There's your problem right there.

Name: Anonymous 2011-09-28 5:49

>>18
You somewhat answered your own question. As stated previously, you need at least a minimal frame of reference.

Name: Anonymous 2011-09-28 5:53

>>19
Please, show us "Infinte Set".

Name: Anonymous 2011-09-28 5:55


  ∧_∧   ∧_∧   ∧_∧   ∧_∧      ∧_∧
 ( ・∀・)   ( `ー´)  ( ´∀`)  ( ゚ ∀゚ )    ( ^∀^)
 (    つ┳∪━━∪━∪━━∪━∪━∪━┳⊂     つ
 | | |  ┃This thread has peacefully ended.┃ | | |
 (__)_) ┻━━━━━━━━━━━━━━┻ (__)_)     Thank you.

Name: Anonymous 2011-09-28 5:58

>>22
No "Infinite Set"? I know you were lying.

Name: >>22 2011-09-28 6:04

>>23-kun I am not >>19. Nevertheless, I'd love to help, but if help came, then everyone is going to want help. The thread has peacefully ended. Ended, it has peacefully.

Name: Anonymous 2011-09-28 6:27

>>21
I would be happy if you could show me an empty set.

Name: Xarn 2011-09-28 6:58

SLACKWARESUPREMACYSLACKWARESUPREMACYSLACKWARESUPREMACYSLACKWARESUPREMACYSLACKWARESUPREMACY

Name: Anonymous 2011-09-28 7:13

>>25
I show you, but you cant see it.

Name: Anonymous 2011-09-28 8:44

>>1
It's a part of a bigger algorithm. E and P might be heavily aliased (refer to same or very close nodes).

Also it might be buggy, notice how it might return undefined value (Result) if all checks fail.

Name: Anonymous 2011-09-28 9:08

>>28
debugfail(254, "cglib/src/cylibdataentry.cpp") originally leaded to C++ exception handler or someting

Name: Anonymous 2011-09-28 9:13

struct Might look something like this..?
..wait, how you do recursive structs.... =/


probably some typedef here?

struct libEntity{
       libEntity *E, *R, *L; //could be left & right, e is up/down?(maybe?)
       };

struct entityPair{
       libEntry  *E, *R;};

Name: Anonymous 2011-09-28 9:15

struct Might look something like this..?
..wait, how you do recursive structs.... =/ ??


probably some typedef here?

struct libEntity{
       libEntity *E, *R, *L; //could be left & right, e is up/down?(maybe?)
       };

struct entityPair{
       libEntry  *E, *R;};

Name: Anonymous 2011-09-28 9:22

test

Name: Anonymous 2011-09-28 9:27

struct Might look something like this..? plus/minus a lot probably,,

struct libEntity{
       libEntity *E, *R, *L; //could be left & right (circular perhaps?), e is up/down?(maybe?)
       };

struct entityPair{
       libEntry  *E, *R;}; //two linked objects? or two pieces of an object? E & R..?


>>cylib :? cyclic library?

Name: Anonymous 2011-09-28 9:31

test

Name: Anonymous 2011-09-28 9:36

test

Name: Anonymous 2011-09-28 9:44

test

Name: Anonymous 2011-09-28 9:56


libEntity *__cdecl cyLibDataEntry254(libEntity *E, entityPair *P)
{

  L = E->L;

// L = E.L;

  if ( (E.)L ) // Got an E.L
  {


      (E.)L->R = E->R;
//E.L.R = E.R

again: (goto loop)


      R = E->R;
// R = E.R

    if ( R ) //Got an E.R
    {
      Result = E->L;  //Result E.L ?
      R->L = Result;  //Set E.R.L as result
    }
    else //Got no E.R
    {
      if ( P->R != E )
        debugfail(254, "cglib/src/cylibdataentry.cpp");
//skip off to somewhere if P.R !=E
 
      Result = E->L; 
      P->R = Result;  //Same as if got an E.R

    }
    E->L = 0; //Zero E.L & E.R
    E->R = 0;
    return Result;
  } 

//End here if we got an E.L // Start here if not

  if ( P->L == E )
  {
    P->L = E->R;
    goto again;
  }
  if ( E->R )
    debugfail(243, "cglib/src/cylibdataentry.cpp");
  return Result;
}

Name: Anonymous 2011-09-28 9:55


libEntity *__cdecl cyLibDataEntry254(libEntity *E, entityPair *P)
{

  L = E->L;

// L = E.L;

  if ( (E.)L ) // Got an E.L
  {


      (E.)L->R = E->R;
//E.L.R = E.R

again: (goto loop)


      R = E->R;
// R = E.R

    if ( R ) //Got an E.R
    {
      Result = E->L;  //Result E.L ?
      R->L = Result;  //Set E.R.L as result
    }
    else //Got no E.R
    {
      if ( P->R != E )
        debugfail(254, "cglib/src/cylibdataentry.cpp");
//skip off to somewhere if P.R !=E
 
      Result = E->L; 
      P->R = Result;  //Same as if got an E.R

    }
    E->L = 0; //Zero E.L & E.R
    E->R = 0;
    return Result;
  } 

//End here if we got an E.L // Start here if not

  if ( P->L == E )
  {
    P->L = E->R;
    goto again;
  }
  if ( E->R )
    debugfail(243, "cglib/src/cylibdataentry.cpp");
  return Result;
}

Name: Anonymous 2011-09-28 11:00

>>33
>cylib :? cyclic library?
cyberlore library
http://en.wikipedia.org/wiki/Cyberlore_Studios

Name: Anonymous 2011-09-28 11:01

>>33
>cylib :? cyclic library?
cyberlore library
http://en.wikipedia.org/wiki/Cyberlore_Studios

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List