Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: third_party/hunspell/google/bdict.cc

Issue 1135173004: Rename third_party/hunspell_new back to third_party/hunspell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/hunspell/google/bdict.h ('k') | third_party/hunspell/google/bdict_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "third_party/hunspell_new/google/bdict.h" 5 #include "third_party/hunspell/google/bdict.h"
6 6
7 // static 7 // static
8 bool hunspell::BDict::Verify(const char* bdict_data, size_t bdict_length) { 8 bool hunspell::BDict::Verify(const char* bdict_data, size_t bdict_length) {
9 if (bdict_length <= sizeof(hunspell::BDict::Header)) 9 if (bdict_length <= sizeof(hunspell::BDict::Header))
10 return false; 10 return false;
11 11
12 const BDict::Header* header = 12 const BDict::Header* header =
13 reinterpret_cast<const hunspell::BDict::Header*>(bdict_data); 13 reinterpret_cast<const hunspell::BDict::Header*>(bdict_data);
14 if (header->signature != hunspell::BDict::SIGNATURE || 14 if (header->signature != hunspell::BDict::SIGNATURE ||
15 header->major_version > hunspell::BDict::MAJOR_VERSION || 15 header->major_version > hunspell::BDict::MAJOR_VERSION ||
(...skipping 15 matching lines...) Expand all
31 // MD5 digest of the data with the one in the BDICT header. 31 // MD5 digest of the data with the one in the BDICT header.
32 if (header->major_version >= 2) { 32 if (header->major_version >= 2) {
33 base::MD5Digest digest; 33 base::MD5Digest digest;
34 base::MD5Sum(aff_header, bdict_length - header->aff_offset, &digest); 34 base::MD5Sum(aff_header, bdict_length - header->aff_offset, &digest);
35 if (memcmp(&digest, &header->digest, sizeof(digest))) 35 if (memcmp(&digest, &header->digest, sizeof(digest)))
36 return false; 36 return false;
37 } 37 }
38 38
39 return true; 39 return true;
40 } 40 }
OLDNEW
« no previous file with comments | « third_party/hunspell/google/bdict.h ('k') | third_party/hunspell/google/bdict_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698