diff options
author | Philipp Hofer <philipp.hofer@protonmail.com> | 2020-11-12 13:08:26 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2020-11-19 19:21:39 +0100 |
commit | de80fdc2060abe5b171bcef72944dd7b914ccd33 (patch) | |
tree | 61f76f37022ea3e7c917afc7da7116275d47cb79 /onlineupdate | |
parent | f54b1d1e0937cf43d74e34bfd5ae921923527a09 (diff) |
tdf#123936 Formatting files in module onlineupdate with clang-format
Change-Id: I17aba4fbf7c2e914e64c62e9370695e20d7c14d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105693
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'onlineupdate')
-rw-r--r-- | onlineupdate/inc/bspatch.h | 10 | ||||
-rw-r--r-- | onlineupdate/source/service/servicebase.hxx | 5 | ||||
-rw-r--r-- | onlineupdate/source/service/workmonitor.hxx | 2 | ||||
-rw-r--r-- | onlineupdate/source/update/common/errors.h | 2 | ||||
-rw-r--r-- | onlineupdate/source/update/common/win_dirent.h | 4 | ||||
-rw-r--r-- | onlineupdate/source/update/updater/progressui.h | 4 | ||||
-rw-r--r-- | onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cxx | 69 |
7 files changed, 37 insertions, 59 deletions
diff --git a/onlineupdate/inc/bspatch.h b/onlineupdate/inc/bspatch.h index ff1a8072964f..e9326262c243 100644 --- a/onlineupdate/inc/bspatch.h +++ b/onlineupdate/inc/bspatch.h @@ -69,7 +69,7 @@ typedef struct MBSPatchHeader_ * @param fd Must have been opened for reading, and be at the beginning * of the file. */ -int MBS_ReadHeader(FILE* file, MBSPatchHeader *header); +int MBS_ReadHeader(FILE* file, MBSPatchHeader* header); /** * Apply a patch. This method does not validate the checksum of the original @@ -82,14 +82,14 @@ int MBS_ReadHeader(FILE* file, MBSPatchHeader *header); * to header->dlen if it is an existing file. The offset * should be at the beginning of the file. */ -int MBS_ApplyPatch(const MBSPatchHeader *header, FILE* patchFile, - unsigned char *fbuffer, FILE* file); +int MBS_ApplyPatch(const MBSPatchHeader* header, FILE* patchFile, unsigned char* fbuffer, + FILE* file); typedef struct MBSPatchTriple_ { uint32_t x; /* add x bytes from oldfile to x bytes from the diff block */ uint32_t y; /* copy y bytes from the extra block */ - int32_t z; /* seek forwards in oldfile by z bytes */ + int32_t z; /* seek forwards in oldfile by z bytes */ } MBSPatchTriple; -#endif // bspatch_h__ +#endif // bspatch_h__ diff --git a/onlineupdate/source/service/servicebase.hxx b/onlineupdate/source/service/servicebase.hxx index c47f966ad551..45375fbe5d32 100644 --- a/onlineupdate/source/service/servicebase.hxx +++ b/onlineupdate/source/service/servicebase.hxx @@ -6,7 +6,7 @@ #include "updatelogging.h" BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra); -BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent); +BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL& sameContent); // 32KiB for comparing files at a time seems reasonable. // The bigger the better for speed, but this will be used @@ -17,6 +17,5 @@ BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent); // Mozilla application as an updater. Before the maintenance service will // execute the updater it must have this updater identity string in its string // table. No other signed Mozilla product will have this string table value. -#define UPDATER_IDENTITY_STRING \ - "libreoffice-updater.exe-7bab28a0-0599-4f37-9efe-f7f8b71f05e3" +#define UPDATER_IDENTITY_STRING "libreoffice-updater.exe-7bab28a0-0599-4f37-9efe-f7f8b71f05e3" #define IDS_UPDATER_IDENTITY 1006 diff --git a/onlineupdate/source/service/workmonitor.hxx b/onlineupdate/source/service/workmonitor.hxx index ac4cd679bf8d..8fc2e51a7ded 100644 --- a/onlineupdate/source/service/workmonitor.hxx +++ b/onlineupdate/source/service/workmonitor.hxx @@ -2,4 +2,4 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -BOOL ExecuteServiceCommand(int argc, LPWSTR *argv); +BOOL ExecuteServiceCommand(int argc, LPWSTR* argv); diff --git a/onlineupdate/source/update/common/errors.h b/onlineupdate/source/update/common/errors.h index 95bdcdfa73e5..2216b54491ee 100644 --- a/onlineupdate/source/update/common/errors.h +++ b/onlineupdate/source/update/common/errors.h @@ -93,4 +93,4 @@ #define FALLBACKKEY_SERVICE_NO_STOP_ERROR 103 #define FALLBACKKEY_LAUNCH_ERROR 104 -#endif // Errors_h__ +#endif // Errors_h__ diff --git a/onlineupdate/source/update/common/win_dirent.h b/onlineupdate/source/update/common/win_dirent.h index ee2ab6c67bd5..fff13f9e0c9f 100644 --- a/onlineupdate/source/update/common/win_dirent.h +++ b/onlineupdate/source/update/common/win_dirent.h @@ -27,5 +27,5 @@ DIR* opendir(const WCHAR* path); int closedir(DIR* dir); dirent* readdir(DIR* dir); -#endif // WNT -#endif // WINDIRENT_H__ +#endif // WNT +#endif // WINDIRENT_H__ diff --git a/onlineupdate/source/update/updater/progressui.h b/onlineupdate/source/update/updater/progressui.h index cb1468d3949c..a3e4913fc32f 100644 --- a/onlineupdate/source/update/updater/progressui.h +++ b/onlineupdate/source/update/updater/progressui.h @@ -17,7 +17,7 @@ #endif // Called to perform any initialization of the widget toolkit -int InitProgressUI(int *argc, NS_tchar ***argv); +int InitProgressUI(int* argc, NS_tchar*** argv); #if defined(_WIN32) // Called on the main thread at startup @@ -33,4 +33,4 @@ void QuitProgressUI(); // May be called from any thread: progress is a number between 0 and 100 void UpdateProgressUI(float progress); -#endif // PROGRESSUI_H__ +#endif // PROGRESSUI_H__ diff --git a/onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cxx b/onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cxx index def164d3808e..17ee57ec400f 100644 --- a/onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cxx +++ b/onlineupdate/source/update/updater/xpcom/glue/nsVersionComparator.cxx @@ -16,38 +16,32 @@ #ifdef _WIN32 // from Mozilla's nsAlgorithm.h -template <class T> -inline const T& -XPCOM_MIN(const T& aA, const T& aB) -{ - return aB < aA ? aB : aA; -} +template <class T> inline const T& XPCOM_MIN(const T& aA, const T& aB) { return aB < aA ? aB : aA; } #endif struct VersionPart { - int32_t numA; + int32_t numA; - const char* strB; // NOT null-terminated, can be a null pointer - uint32_t strBlen; + const char* strB; // NOT null-terminated, can be a null pointer + uint32_t strBlen; - int32_t numC; + int32_t numC; - char* extraD; // null-terminated + char* extraD; // null-terminated }; #ifdef _WIN32 struct VersionPartW { - int32_t numA; - - wchar_t* strB; // NOT null-terminated, can be a null pointer - uint32_t strBlen; + int32_t numA; - int32_t numC; + wchar_t* strB; // NOT null-terminated, can be a null pointer + uint32_t strBlen; - wchar_t* extraD; // null-terminated + int32_t numC; + wchar_t* extraD; // null-terminated }; #endif @@ -56,8 +50,7 @@ struct VersionPartW * * @returns A pointer to the next versionpart, or null if none. */ -static char* -ParseVP(char* aPart, VersionPart& aResult) +static char* ParseVP(char* aPart, VersionPart& aResult) { char* dot; @@ -136,17 +129,14 @@ ParseVP(char* aPart, VersionPart& aResult) return dot; } - /** * Parse a version part into a number and "extra text". * * @returns A pointer to the next versionpart, or null if none. */ #ifdef _WIN32 -static wchar_t* -ParseVP(wchar_t* aPart, VersionPartW& aResult) +static wchar_t* ParseVP(wchar_t* aPart, VersionPartW& aResult) { - wchar_t* dot; aResult.numA = 0; @@ -226,8 +216,7 @@ ParseVP(wchar_t* aPart, VersionPartW& aResult) #endif // compare two null-terminated strings, which may be null pointers -static int32_t -ns_strcmp(const char* aStr1, const char* aStr2) +static int32_t ns_strcmp(const char* aStr1, const char* aStr2) { // any string is *before* no string if (!aStr1) @@ -244,9 +233,7 @@ ns_strcmp(const char* aStr1, const char* aStr2) } // compare two length-specified string, which may be null pointers -static int32_t -ns_strnncmp(const char* aStr1, uint32_t aLen1, - const char* aStr2, uint32_t aLen2) +static int32_t ns_strnncmp(const char* aStr1, uint32_t aLen1, const char* aStr2, uint32_t aLen2) { // any string is *before* no string if (!aStr1) @@ -281,8 +268,7 @@ ns_strnncmp(const char* aStr1, uint32_t aLen1, } // compare two int32_t -static int32_t -ns_cmp(int32_t aNum1, int32_t aNum2) +static int32_t ns_cmp(int32_t aNum1, int32_t aNum2) { if (aNum1 < aNum2) { @@ -295,8 +281,7 @@ ns_cmp(int32_t aNum1, int32_t aNum2) /** * Compares two VersionParts */ -static int32_t -CompareVP(VersionPart& aVer1, VersionPart& aVer2) +static int32_t CompareVP(VersionPart& aVer1, VersionPart& aVer2) { int32_t r = ns_cmp(aVer1.numA, aVer2.numA); if (r) @@ -323,8 +308,7 @@ CompareVP(VersionPart& aVer1, VersionPart& aVer2) * Compares two VersionParts */ #ifdef _WIN32 -static int32_t -CompareVP(VersionPartW& aVer1, VersionPartW& aVer2) +static int32_t CompareVP(VersionPartW& aVer1, VersionPartW& aVer2) { int32_t r = ns_cmp(aVer1.numA, aVer2.numA); if (r) @@ -358,11 +342,10 @@ CompareVP(VersionPartW& aVer1, VersionPartW& aVer2) } #endif -namespace mozilla { - +namespace mozilla +{ #ifdef _WIN32 -int32_t -CompareVersions(const wchar_t* aStrA, const wchar_t* aStrB) +int32_t CompareVersions(const wchar_t* aStrA, const wchar_t* aStrB) { wchar_t* A2 = wcsdup(aStrA); if (!A2) @@ -394,8 +377,7 @@ CompareVersions(const wchar_t* aStrA, const wchar_t* aStrB) break; } - } - while (a || b); + } while (a || b); free(A2); free(B2); @@ -404,8 +386,7 @@ CompareVersions(const wchar_t* aStrA, const wchar_t* aStrB) } #endif -int32_t -CompareVersions(const char* aStrA, const char* aStrB) +int32_t CompareVersions(const char* aStrA, const char* aStrB) { char* A2 = strdup(aStrA); if (!A2) @@ -437,8 +418,7 @@ CompareVersions(const char* aStrA, const char* aStrB) break; } - } - while (a || b); + } while (a || b); free(A2); free(B2); @@ -447,4 +427,3 @@ CompareVersions(const char* aStrA, const char* aStrB) } } // namespace mozilla - |