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

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

Issue 3083012: Tidying up. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « documentation/DoxygenLayout.xml ('k') | import/cross/archive_request.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (file_length == 0) return FAILURE; 68 if (file_length == 0) return FAILURE;
69 69
70 MemoryBuffer<uint8> buffer; 70 MemoryBuffer<uint8> buffer;
71 buffer.Allocate(file_length); 71 buffer.Allocate(file_length);
72 uint8 *p = buffer; 72 uint8 *p = buffer;
73 73
74 // Test by reading in a tar.gz file and sending through the 74 // Test by reading in a tar.gz file and sending through the
75 // progressive streaming system 75 // progressive streaming system
76 FILE *fp = fopen(filename, "rb"); 76 FILE *fp = fopen(filename, "rb");
77 if (!fp) return FAILURE; // can't open file! 77 if (!fp) return FAILURE; // can't open file!
78 if (static_cast<size_t>(file_length) != 78 if (static_cast<size_t>(file_length) !=
79 fread(p, sizeof(uint8), file_length, fp)) 79 fread(p, sizeof(uint8), file_length, fp))
80 return FAILURE; 80 return FAILURE;
81 if (0 != fclose(fp)) return FAILURE; 81 if (0 != fclose(fp)) return FAILURE;
82 82
83 MemoryReadStream stream(p, file_length); 83 MemoryReadStream stream(p, file_length);
84 84
85 return ProcessEntireStream(&stream); 85 return ProcessEntireStream(&stream);
86 } 86 }
87 87
88 } // namespace o3d 88 } // namespace o3d
OLDNEW
« no previous file with comments | « documentation/DoxygenLayout.xml ('k') | import/cross/archive_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698