AP_Terrain: constify get_statistics and bitount64

This commit is contained in:
Randy Mackay 2019-11-07 11:02:23 +09:00
parent fc61cf3d3c
commit 356a5fcc5a
2 changed files with 4 additions and 4 deletions

View File

@ -177,7 +177,7 @@ public:
/* /*
get some statistics for TERRAIN_REPORT get some statistics for TERRAIN_REPORT
*/ */
void get_statistics(uint16_t &pending, uint16_t &loaded); void get_statistics(uint16_t &pending, uint16_t &loaded) const;
private: private:
// allocate the terrain subsystem data // allocate the terrain subsystem data
@ -308,7 +308,7 @@ private:
/* /*
get some statistics for TERRAIN_REPORT get some statistics for TERRAIN_REPORT
*/ */
uint8_t bitcount64(uint64_t b); uint8_t bitcount64(uint64_t b) const;
/* /*
disk IO functions disk IO functions

View File

@ -149,7 +149,7 @@ void AP_Terrain::send_request(mavlink_channel_t chan)
/* /*
count bits in a uint64_t count bits in a uint64_t
*/ */
uint8_t AP_Terrain::bitcount64(uint64_t b) uint8_t AP_Terrain::bitcount64(uint64_t b) const
{ {
return __builtin_popcount((unsigned)(b&0xFFFFFFFF)) + __builtin_popcount((unsigned)(b>>32)); return __builtin_popcount((unsigned)(b&0xFFFFFFFF)) + __builtin_popcount((unsigned)(b>>32));
} }
@ -157,7 +157,7 @@ uint8_t AP_Terrain::bitcount64(uint64_t b)
/* /*
get some statistics for TERRAIN_REPORT get some statistics for TERRAIN_REPORT
*/ */
void AP_Terrain::get_statistics(uint16_t &pending, uint16_t &loaded) void AP_Terrain::get_statistics(uint16_t &pending, uint16_t &loaded) const
{ {
pending = 0; pending = 0;
loaded = 0; loaded = 0;