]> git.saurik.com Git - apt.git/blobdiff - methods/rred.cc
follow the recommendation of cppcheck to make some method methods (scnr)
[apt.git] / methods / rred.cc
index 9ad0e44646db82711c62014ae3a9613fa051c134..6c55880ca1726c782bd1f939c50952a7f083c0ba 100644 (file)
@@ -51,7 +51,7 @@ protected:
        virtual bool Fetch(FetchItem *Itm);
 
 public:
        virtual bool Fetch(FetchItem *Itm);
 
 public:
-       RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig) {};
+       RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig), Debug(false) {};
 };
                                                                                /*}}}*/
 /** \brief applyFile - in reverse order with a tail recursion                  {{{
 };
                                                                                /*}}}*/
 /** \brief applyFile - in reverse order with a tail recursion                  {{{
@@ -239,7 +239,9 @@ RredMethod::State RredMethod::patchFile(FileFd &Patch, FileFd &From,                /*{{{*/
    return result;
 }
                                                                                /*}}}*/
    return result;
 }
                                                                                /*}}}*/
-struct EdCommand {                                                             /*{{{*/
+/* struct EdCommand                                                            {{{*/
+#ifdef _POSIX_MAPPED_FILES
+struct EdCommand {
   size_t data_start;
   size_t data_end;
   size_t data_lines;
   size_t data_start;
   size_t data_end;
   size_t data_lines;
@@ -248,6 +250,7 @@ struct EdCommand {                                                          /*{{{*/
   char type;
 };
 #define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */
   char type;
 };
 #define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */
+#endif
                                                                                /*}}}*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,           /*{{{*/
                                        FileFd &out_file, Hashes *hash) const {
                                                                                /*}}}*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,           /*{{{*/
                                        FileFd &out_file, Hashes *hash) const {
@@ -256,7 +259,7 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,                /*{{{*/
        if (Patch.gzFd() != NULL) {
                unsigned long mapSize = Patch.Size();
                DynamicMMap* dyn = new DynamicMMap(0, mapSize, 0);
        if (Patch.gzFd() != NULL) {
                unsigned long mapSize = Patch.Size();
                DynamicMMap* dyn = new DynamicMMap(0, mapSize, 0);
-               if (dyn->Data() == 0) {
+               if (dyn->validData() == false) {
                        delete dyn;
                        return MMAP_FAILED;
                }
                        delete dyn;
                        return MMAP_FAILED;
                }