]> git.saurik.com Git - apt.git/commitdiff
fileutl: simple_buffer: Mark accessors as const
authorJulian Andres Klode <jak@debian.org>
Sun, 27 Dec 2015 14:33:59 +0000 (15:33 +0100)
committerJulian Andres Klode <jak@debian.org>
Sun, 27 Dec 2015 14:43:13 +0000 (15:43 +0100)
Suggested by David.

Gbp-Dch: ignore

apt-pkg/contrib/fileutl.cc

index b1f1c78a2215829ec4405907a5a59485aa5894e3..38ae0246ead05a1498c20f225a4f1b2cd6da636f 100644 (file)
@@ -925,9 +925,10 @@ struct APT_HIDDEN simple_buffer {                                                  /*{{{*/
    unsigned long long bufferend = 0;
    char buffer[buffersize_max];
 
+   const char *get() const { return buffer + bufferstart; }
    char *get() { return buffer + bufferstart; }
-   bool empty() { return bufferend <= bufferstart; }
-   unsigned long long size() { return bufferend-bufferstart; }
+   bool empty() const { return bufferend <= bufferstart; }
+   unsigned long long size() const { return bufferend-bufferstart; }
    void reset() { bufferend = bufferstart = 0; }
    ssize_t read(void *to, unsigned long long requested_size) APT_MUSTCHECK
    {