Skip to content

Commit

Permalink
fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Johennecken, Peter authored and Johennecken, Peter committed Jun 6, 2018
1 parent 3951f0e commit 1010ec0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 38 deletions.
18 changes: 6 additions & 12 deletions CNFGXDriver.c
@@ -1,5 +1,5 @@
//Copyright (c) 2011, 2017 <>< Charles Lohr - Under the MIT/x11 or NewBSD License you choose.
//portions from
//portions from
//http://www.xmission.com/~georgeps/documentation/tutorials/Xlib_Beginner.html

//#define HAS_XINERAMA
Expand Down Expand Up @@ -128,8 +128,8 @@ void CNFGSetupFullscreen( const char * WindowName, int screen_no )

CNFGWindow = XCreateWindow(CNFGDisplay, XRootWindow(CNFGDisplay, screen),
xpos, ypos, CNFGWinAtt.width, CNFGWinAtt.height,
0, CNFGWinAtt.depth, InputOutput, CNFGVisual,
CWBorderPixel | CWEventMask | CWOverrideRedirect | CWSaveUnder,
0, CNFGWinAtt.depth, InputOutput, CNFGVisual,
CWBorderPixel | CWEventMask | CWOverrideRedirect | CWSaveUnder,
&setwinattr);

XMapWindow(CNFGDisplay, CNFGWindow);
Expand Down Expand Up @@ -173,7 +173,7 @@ void CNFGSetup( const char * WindowName, int w, int h )

#ifdef CNFGOGL
int attribs[] = { GLX_RGBA,
GLX_DOUBLEBUFFER,
GLX_DOUBLEBUFFER,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
Expand Down Expand Up @@ -214,10 +214,9 @@ void CNFGHandleInput()
XEvent report;

int bKeyDirection = 1;
int r;
while( XPending( CNFGDisplay ) )
{
r=XNextEvent( CNFGDisplay, &report );
XNextEvent( CNFGDisplay, &report );

bKeyDirection = 1;
switch (report.type)
Expand Down Expand Up @@ -263,8 +262,6 @@ void CNFGUpdateScreenWithBitmap( unsigned long * data, int w, int h )
static XImage *xi;
static int depth;
static int lw, lh;
static unsigned char * lbuffer;
int r, ls;

if( !xi )
{
Expand All @@ -282,9 +279,6 @@ void CNFGUpdateScreenWithBitmap( unsigned long * data, int w, int h )
lw = w;
lh = h;
}

ls = lw * lh;

XPutImage(CNFGDisplay, CNFGWindow, CNFGWindowGC, xi, 0, 0, 0, 0, w, h );
}

Expand Down Expand Up @@ -324,7 +318,7 @@ uint32_t CNFGColor( uint32_t RGB )
void CNFGClearFrame()
{
XGetWindowAttributes( CNFGDisplay, CNFGWindow, &CNFGWinAtt );
XSetForeground(CNFGDisplay, CNFGGC, CNFGColor(CNFGBGColor) );
XSetForeground(CNFGDisplay, CNFGGC, CNFGColor(CNFGBGColor) );
XFillRectangle(CNFGDisplay, CNFGPixmap, CNFGGC, 0, 0, CNFGWinAtt.width, CNFGWinAtt.height );
}

Expand Down
9 changes: 1 addition & 8 deletions cnping-mousey.c
Expand Up @@ -262,14 +262,11 @@ int main( int argc, const char ** argv )
#endif
{
char title[1024];
int i, x, y, r;
int i;
double ThisTime;
double LastFPSTime = OGGetAbsoluteTime();
double LastFrameTime = OGGetAbsoluteTime();
double SecToWait;
int linesegs = 0;
// struct in_addr dst;
struct addrinfo *result;

srand( (int)(OGGetAbsoluteTime()*100000) );

Expand Down Expand Up @@ -310,10 +307,7 @@ int main( int argc, const char ** argv )

while(1)
{
int i, pos;
float f;
iframeno++;
RDPoint pto[3];


if( notemode && lastnoteupdown > 0 && OGGetAbsoluteTime() - lastnoteupdown > .05 )
Expand All @@ -335,7 +329,6 @@ int main( int argc, const char ** argv )
if( ThisTime > LastFPSTime + 1 )
{
frames = 0;
linesegs = 0;
LastFPSTime+=1;
}

Expand Down
Binary file removed cnping.exe
Binary file not shown.
12 changes: 3 additions & 9 deletions ping.c
Expand Up @@ -84,7 +84,7 @@ uint16_t checksum( const unsigned char * start, uint16_t len )
const uint16_t * wptr = (uint16_t*) start;
uint32_t csum = 0;
for (i=1;i<len;i+=2)
csum += (uint32_t)(*(wptr++));
csum += (uint32_t)(*(wptr++));
if( len & 1 ) //See if there's an odd number of bytes?
csum += *(uint8_t*)wptr;
if (csum>>16)
Expand Down Expand Up @@ -115,7 +115,7 @@ void listener()
for (;;)
{
socklen_t addrlenval=sizeof(addr);
int bytes;
int bytes;

#ifdef WIN32
WSAPOLLFD fda[1];
Expand Down Expand Up @@ -146,13 +146,7 @@ void listener()

void ping(struct sockaddr_in *addr )
{
#ifdef WIN32
const char val=255;
#else
const int val=255;
#endif
int i, cnt=1;
struct sockaddr_in r_addr;
int cnt=1;

#ifdef WIN32
{
Expand Down
9 changes: 0 additions & 9 deletions searchnet.c
Expand Up @@ -19,17 +19,8 @@ void * PingListen( void * r )

void display(uint8_t *buf, int bytes)
{
int i;
uint32_t reqid = ((uint32_t)buf[0+1] << 24) | (buf[1+1]<<16) | (buf[2+1]<<8) | (buf[3+1]);

/* for( i = 0; i < bytes; i++ )
{
printf( "%02x ", buf[i] );
}
printf( "\n" );
printf( "REQ: %08x %08x\n", reqid, my_random_key );
/// printf( "%d.%d.%d.%d\n", buf[4], buf[5], buf[6], buf[7] );
*/
if( reqid != my_random_key ) return;

printf( "%d.%d.%d.%d\n", buf[4+1], buf[5+1], buf[6+1], buf[7+1] );
Expand Down

0 comments on commit 1010ec0

Please sign in to comment.