Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 9, 2022
1 parent 78b0e74 commit 5008dd4
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions pogl_glut.xs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ static void set_glut_win_handler(int win, int type, SV * data)
{
SV ** h;
AV * a;

if (!glut_handlers)
glut_handlers = newAV();

h = av_fetch(glut_handlers, win, FALSE);

if (!h) {
a = newAV();
av_store(glut_handlers, win, newRV_inc((SV*)a));
SvREFCNT_dec(a);
} else if (!SvOK(*h) || !SvROK(*h))
croak("Unable to establish glut handler");
else
else
a = (AV*)SvRV(*h);

av_store(a, type, newRV_inc(data));
SvREFCNT_dec(data);
}
Expand All @@ -72,17 +72,17 @@ static void set_glut_win_handler(int win, int type, SV * data)
static SV * get_glut_win_handler(int win, int type)
{
SV ** h;

if (!glut_handlers)
croak("Unable to locate glut handler");

h = av_fetch(glut_handlers, win, FALSE);

if (!h || !SvOK(*h) || !SvROK(*h))
croak("Unable to locate glut handler");

h = av_fetch((AV*)SvRV(*h), type, FALSE);

if (!h || !SvOK(*h) || !SvROK(*h))
croak("Unable to locate glut handler");

Expand All @@ -93,12 +93,12 @@ static SV * get_glut_win_handler(int win, int type)
static void destroy_glut_win_handlers(int win)
{
SV ** h;

if (!glut_handlers)
return;

h = av_fetch(glut_handlers, win, FALSE);

if (!h || !SvOK(*h) || !SvROK(*h))
return;

Expand All @@ -110,17 +110,17 @@ static void destroy_glut_win_handler(int win, int type)
{
SV ** h;
AV * a;

if (!glut_handlers)
glut_handlers = newAV();

h = av_fetch(glut_handlers, win, FALSE);

if (!h || !SvOK(*h) || !SvROK(*h))
return;

a = (AV*)SvRV(*h);

av_store(a, type, newSVsv(&PL_sv_undef));
}

Expand Down Expand Up @@ -458,7 +458,7 @@ static void generic_glut_timer_handler(int value)

PUTBACK;
DO_perl_call_sv(handler, G_DISCARD);

SvREFCNT_dec(handler_data);
}

Expand All @@ -472,11 +472,11 @@ static void generic_glut_menu_handler(int value)
SV ** h;
int i;
dSP;

h = av_fetch(glut_menu_handlers, glutGetMenu(), FALSE);
if (!h || !SvOK(*h) || !SvROK(*h))
croak("Unable to locate menu handler");

handler_data = (AV*)SvRV(*h);

handler = *av_fetch(handler_data, 0, 0);
Expand Down Expand Up @@ -526,23 +526,23 @@ glutInit()
argv = 0;
ARGV = perl_get_av("ARGV", FALSE);
ARGV0 = perl_get_sv("0", FALSE);

argc = av_len(ARGV)+2;
if (argc) {
argv = malloc(sizeof(char*)*argc);
argv[0] = SvPV(ARGV0, PL_na);
for(i=0;i<=av_len(ARGV);i++)
argv[i+1] = SvPV(*av_fetch(ARGV, i, 0), PL_na);
}

i = argc;
glutInit(&argc, argv);

_done_glutInit = 1;

while(argc<i--)
sv = av_shift(ARGV);

if (argv)
free(argv);
}
Expand Down Expand Up @@ -686,7 +686,7 @@ glutSetCursor(cursor)

#if GLUT_API_VERSION >= 3

#//# glutEstablishOverlay();
#//# glutEstablishOverlay();
void
glutEstablishOverlay()

Expand Down Expand Up @@ -725,18 +725,18 @@ glutCreateMenu(handler=0, ...)
croak("A handler must be specified");
} else {
AV * handler_data = newAV();

PackCallbackST(handler_data, 0);

RETVAL = glutCreateMenu(generic_glut_menu_handler);

if (!glut_menu_handlers)
glut_menu_handlers = newAV();

av_store(glut_menu_handlers, RETVAL, newRV_inc((SV*)handler_data));

SvREFCNT_dec(handler_data);

}
}
OUTPUT:
Expand Down Expand Up @@ -1015,9 +1015,9 @@ glutTimerFunc(msecs, handler=0, ...)
croak("A handler must be specified");
} else {
AV * handler_data = newAV();

PackCallbackST(handler_data, 1);

glutTimerFunc(msecs, generic_glut_timer_handler, (int)handler_data);
}
ENSURE_callback_thread;}
Expand Down

0 comments on commit 5008dd4

Please sign in to comment.