]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/hashsum_template.h
The entire concept of PendingError() is flawed :/.
[apt.git] / apt-pkg / contrib / hashsum_template.h
index 42248f6ac55202fdb1d78bcc38924eebb2e52a22..e5032d02fd6f7b4f2e284cc65e801c9f030fb714 100644 (file)
@@ -79,18 +79,15 @@ class HashSumValue
       return Value();
    }
 
-   bool Set(std::string Str)
-   {
-      return Hex2Num(Str,Sum,sizeof(Sum));
-   }
 #ifdef APT_PKG_EXPOSE_STRING_VIEW
    APT_HIDDEN bool Set(APT::StringView Str)
    {
       return Hex2Num(Str,Sum,sizeof(Sum));
    }
-   APT_HIDDEN bool Set(const char *Str)
+#else
+   bool Set(std::string Str)
    {
-      return Hex2Num(APT::StringView(Str),Sum,sizeof(Sum));
+      return Hex2Num(Str,Sum,sizeof(Sum));
    }
 #endif
    inline void Set(unsigned char S[N/8])
@@ -125,18 +122,18 @@ class HashSumValue
 class SummationImplementation
 {
    public:
-   virtual bool Add(const unsigned char *inbuf, unsigned long long inlen) = 0;
-   inline bool Add(const char *inbuf, unsigned long long const inlen)
+   virtual bool Add(const unsigned char *inbuf, unsigned long long inlen) APT_NONNULL(2) = 0;
+   inline bool Add(const char *inbuf, unsigned long long const inlen) APT_NONNULL(2)
    { return Add((const unsigned char *)inbuf, inlen); }
 
-   inline bool Add(const unsigned char *Data)
+   inline bool Add(const unsigned char *Data) APT_NONNULL(2)
    { return Add(Data, strlen((const char *)Data)); }
-   inline bool Add(const char *Data)
+   inline bool Add(const char *Data) APT_NONNULL(2)
    { return Add((const unsigned char *)Data, strlen(Data)); }
 
-   inline bool Add(const unsigned char *Beg, const unsigned char *End)
+   inline bool Add(const unsigned char *Beg, const unsigned char *End) APT_NONNULL(2,3)
    { return Add(Beg, End - Beg); }
-   inline bool Add(const char *Beg, const char *End)
+   inline bool Add(const char *Beg, const char *End) APT_NONNULL(2,3)
    { return Add((const unsigned char *)Beg, End - Beg); }
 
    bool AddFD(int Fd, unsigned long long Size = 0);