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

Side by Side Diff: import/cross/tar_processor.cc

Issue 159168: This fixes a number of things that are warnings in the Mac compiler.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (bytes_read != bytes_to_read) { 55 if (bytes_read != bytes_to_read) {
56 return -1; 56 return -1;
57 } 57 }
58 58
59 header_bytes_read_ += bytes_to_read; 59 header_bytes_read_ += bytes_to_read;
60 bytes_to_consume -= bytes_to_read; 60 bytes_to_consume -= bytes_to_read;
61 61
62 if (header_bytes_read_ == TAR_HEADER_SIZE) { 62 if (header_bytes_read_ == TAR_HEADER_SIZE) {
63 const char *filename = (const char *)header_; 63 const char *filename = (const char *)header_;
64 64
65 // The tar format stupidly represents size_teger values as 65 // The tar format stupidly represents size_t integer values as
66 // octal strings!! 66 // octal strings!!
67 size_t file_size = 0; 67 unsigned int file_size = 0u;
68 sscanf(header_ + 124, "%o", &file_size); 68 sscanf(header_ + 124, "%o", &file_size);
69 69
70 // Only callback client if this is a "real" header 70 // Only callback client if this is a "real" header
71 // (filename is not NULL) 71 // (filename is not NULL)
72 // Extra zero-padding can be added by the gzip compression 72 // Extra zero-padding can be added by the gzip compression
73 // (at end of archive), so ignore these ones. 73 // (at end of archive), so ignore these ones.
74 // 74 //
75 // Also, ignore entries for directories (which have zero size) 75 // Also, ignore entries for directories (which have zero size)
76 if (header_[0] != 0 && file_size > 0) { 76 if (header_[0] != 0 && file_size > 0) {
77 ArchiveFileInfo info(filename, file_size); 77 ArchiveFileInfo info(filename, file_size);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // setting to 0 makes us want more header bytes 135 // setting to 0 makes us want more header bytes
136 header_bytes_read_ = 0; 136 header_bytes_read_ = 0;
137 } 137 }
138 } 138 }
139 } 139 }
140 140
141 return 0; 141 return 0;
142 } 142 }
143 143
144 } // namespace o3d 144 } // namespace o3d
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698