Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
xosview
xosview-1.8.3-longint.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xosview-1.8.3-longint.patch of Package xosview
--- linux/intmeter.cc +++ linux/intmeter.cc 2008-04-25 12:17:52.908244127 +0200 @@ -24,7 +24,7 @@ static int realintnum[1024]; IntMeter::IntMeter( XOSView *parent, int cpu) : BitMeter( parent, "INTS", "", 1, - 0, 0 ), _cpu(cpu), _old(true) { + 0, 0 ), _cpu(cpu), _old(true), max(sizeof(realintnum)/sizeof(realintnum[0])) { if (getLinuxVersion() <= 2.0) _old = true; else @@ -81,8 +81,8 @@ int IntMeter::countCPUs(void) { void IntMeter::getirqs( void ){ std::ifstream intfile( INTFILE ); - int intno, count; - int idx; + unsigned long idx, count; + int intno = 0; if ( !intfile ){ std::cerr <<"Can not open file : " <<INTFILE << std::endl; @@ -90,19 +90,20 @@ void IntMeter::getirqs( void ){ } if (!_old) - intfile.ignore(1024, '\n'); + intfile.ignore(max, '\n'); while ( !intfile.eof() ){ intfile >> idx; - intno = realintnum[idx]; + if (idx < (unsigned long)max) + intno = realintnum[idx]; if(intno>=numBits()) updateirqcount(intno,false); if (!intfile) break; intfile.ignore(1); if ( !intfile.eof() ){ for (int i = 0 ; i <= _cpu ; i++) - intfile >>count; - intfile.ignore(1024, '\n'); + intfile >> count; + intfile.ignore(max, '\n'); irqs_[intno] = count; } @@ -120,7 +121,7 @@ void IntMeter::updateirqcount( int n, bo std::ostringstream os; os << "INTs (0-16" ; - for (int i=16; i<1024; i++) { + for (int i=16; i<max; i++) { if (realintnum[i]) os << ", " << (i) ; } @@ -157,21 +158,22 @@ void IntMeter::updateirqcount( int n, bo */ void IntMeter::initirqcount( void ){ std::ifstream intfile( INTFILE ); + unsigned long idx; int intno = 0; - int i, idx; + int i; if ( !intfile ){ std::cerr <<"Can not open file : " <<INTFILE << std::endl; exit( 1 ); } - if (!_old) { - for (i=0; i<1024; i++) // init index into int array + if (!_old) { // init index into int array + for (i=0; i<max; i++) if (i < 16) // first 16 map directly realintnum[i] = i; else realintnum[i] = 0; - intfile.ignore(1024, '\n'); + intfile.ignore(max, '\n'); } /* just looking for the highest number interrupt that @@ -184,10 +186,11 @@ void IntMeter::initirqcount( void ){ intno = i; else { intno = idx; - realintnum[i] = idx++; + if (i < max) + realintnum[i] = idx++; } if (!intfile) break; - intfile.ignore(1024, '\n'); + intfile.ignore(max, '\n'); } updateirqcount(intno, true); } --- linux/intmeter.h +++ linux/intmeter.h 2008-04-25 12:15:41.363406730 +0200 @@ -28,6 +28,7 @@ protected: int _cpu; bool _old; + const int max; void getirqs( void ); void updateirqcount( int n, bool init );
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor