Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 309525 Details for
Bug 448748
Review Request: cylindrix - 3 degrees of freedom combat game
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
cylindrix-1.0-arch-independ-file-write.patch
cylindrix-1.0-arch-independ-file-write.patch (text/plain), 3.46 KB, created by
Hans de Goede
on 2008-06-16 19:23:20 UTC
(
hide
)
Description:
cylindrix-1.0-arch-independ-file-write.patch
Filename:
MIME Type:
Creator:
Hans de Goede
Created:
2008-06-16 19:23:20 UTC
Size:
3.46 KB
patch
obsolete
>diff -up cylindrix/stats.c~ cylindrix/stats.c >--- cylindrix/stats.c~ 2008-06-16 20:13:07.000000000 +0200 >+++ cylindrix/stats.c 2008-06-16 20:13:07.000000000 +0200 >@@ -254,23 +254,57 @@ int Save_Overall_Stats_Text( overall_sta > } /* End of Save_Overall_Stats_Text() */ > > >+/* Write overal stats as a binary dump of overall_stats_type on i386, >+ do this in an arch independent way. >+ >+ Note we use the same brillaint error handling as the original fwrite >+ call: none :) */ >+void write_overall_stats(overall_stats_type *overall_stats, PACKFILE *fp) >+{ >+ union { >+ int i; >+ float f; >+ } u; >+ >+ pack_fwrite(overall_stats->name, 80, fp); >+ pack_iputl(overall_stats->number_of_games, fp); >+ pack_iputl(overall_stats->victories, fp); >+ pack_iputl(overall_stats->defeats, fp); >+ >+ u.f = overall_stats->win_percentage; >+ pack_iputl(u.i, fp); >+ >+ pack_iputl(overall_stats->kills, fp); >+ pack_iputl(overall_stats->times_killed, fp); >+ pack_iputl(overall_stats->shots_fired, fp); >+ pack_iputl(overall_stats->enemy_hits, fp); >+ pack_iputl(overall_stats->friendly_hits, fp); >+ pack_iputl(overall_stats->misses, fp); >+ pack_iputl(overall_stats->times_hit, fp); >+ >+ u.f = overall_stats->hit_percentage; >+ pack_iputl(u.i, fp); >+ >+ pack_iputl(overall_stats->pylons_grabbed, fp); >+} >+ > int Save_Overall_Stats_Binary( overall_stats_type *overall_stats, char *filename ) > { >- FILE *fp; >+ PACKFILE *fp; > char newfilename[512]; > > sprintf(newfilename,"%s%s",g_DataPath,filename); > > > >- fp = fopen( newfilename, "wb" ); >+ fp = pack_fopen( newfilename, "w" ); > > if( fp == NULL ) > return(0); > >- fwrite( overall_stats, sizeof(overall_stats_type), 1, fp ); >+ write_overall_stats( overall_stats, fp ); > >- fclose(fp); >+ pack_fclose(fp); > > return(1); > } /* End of Save_Overall_Stats_Binary() */ >diff -up cylindrix/menu.c~ cylindrix/menu.c >--- cylindrix/menu.c~ 2008-06-16 20:28:35.000000000 +0200 >+++ cylindrix/menu.c 2008-06-16 20:28:35.000000000 +0200 >@@ -7670,7 +7670,7 @@ void view_stats_menu_return_key() > > for( i = 0; i < 1000; i++ ) { > >- sprintf( filename, "%sSTATS/OVER%03d.TXT", g_DataPath, i ); >+ sprintf( filename, "%sstats/over%03d.txt", g_DataPath, i ); > > if( (fp = fopen( filename, "r" ) ) == NULL ) { > >@@ -9822,7 +9822,7 @@ void custom_game_stat_menu_return_key() > > for( i = 0; i < 1000; i++ ) { > >- sprintf( filename, "%sSTATS/CUST%03d.TXT", g_DataPath, i ); >+ sprintf( filename, "%sstats/cust%03d.txt", g_DataPath, i ); > > if( (fp = fopen( filename, "r" ) ) == NULL ) { > >@@ -10234,7 +10234,7 @@ void tournament_game_stat_menu_return_ke > > for( i = 0; i < 1000; i++ ) { > >- sprintf( filename, "%sSTATS/TOUR%03d.TXT", g_DataPath, i ); >+ sprintf( filename, "%sstats/tour%03d.txt", g_DataPath, i ); > > if( (fp = fopen( filename, "r" ) ) == NULL ) { > >diff -up cylindrix/config.c~ cylindrix/config.c >--- cylindrix/config.c~ 2008-06-16 21:16:12.000000000 +0200 >+++ cylindrix/config.c 2008-06-16 21:16:12.000000000 +0200 >@@ -441,7 +441,7 @@ void Save_Game_Configuration( game_confi > sprintf(newfilename,"%sgamedata/game.cfg",g_DataPath); > > >- fp = fopen( newfilename, "r" ); >+ fp = fopen( newfilename, "w" ); > > > switch( game_configuration->serial_com_port )
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 448748
:
309415
|
309416
|
309417
|
309525
|
309526