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

Side by Side Diff: courgette/encoded_program.cc

Issue 371153002: Fixes for re-enabling more MSVC level 4 warnings: courgette/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « courgette/disassembler_elf_32_arm.cc ('k') | no next file » | 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 "courgette/encoded_program.h" 5 #include "courgette/encoded_program.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 uint32 page_rva; 703 uint32 page_rva;
704 uint32 block_size; 704 uint32 block_size;
705 uint16 relocs[4096]; // Allow up to one relocation per byte of a 4k page. 705 uint16 relocs[4096]; // Allow up to one relocation per byte of a 4k page.
706 }; 706 };
707 707
708 COMPILE_ASSERT(offsetof(RelocBlockPOD, relocs) == 8, reloc_block_header_size); 708 COMPILE_ASSERT(offsetof(RelocBlockPOD, relocs) == 8, reloc_block_header_size);
709 709
710 class RelocBlock { 710 class RelocBlock {
711 public: 711 public:
712 RelocBlock() { 712 RelocBlock() {
713 pod.page_rva = ~0; 713 pod.page_rva = 0xFFFFFFFF;
tommi (sloooow) - chröme 2014/07/08 07:56:15 I'm curious - does this actually make a difference
Peter Kasting 2014/07/08 19:33:47 ~0 is signed (I believe because 0 is signed), whil
714 pod.block_size = 8; 714 pod.block_size = 8;
715 } 715 }
716 716
717 void Add(uint16 item) { 717 void Add(uint16 item) {
718 pod.relocs[(pod.block_size-8)/2] = item; 718 pod.relocs[(pod.block_size-8)/2] = item;
719 pod.block_size += 2; 719 pod.block_size += 2;
720 } 720 }
721 721
722 CheckBool Flush(SinkStream* buffer) WARN_UNUSED_RESULT { 722 CheckBool Flush(SinkStream* buffer) WARN_UNUSED_RESULT {
723 bool ok = true; 723 bool ok = true;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 if (assembled) 793 if (assembled)
794 return C_OK; 794 return C_OK;
795 return C_ASSEMBLY_FAILED; 795 return C_ASSEMBLY_FAILED;
796 } 796 }
797 797
798 void DeleteEncodedProgram(EncodedProgram* encoded) { 798 void DeleteEncodedProgram(EncodedProgram* encoded) {
799 delete encoded; 799 delete encoded;
800 } 800 }
801 801
802 } // end namespace 802 } // end namespace
OLDNEW
« no previous file with comments | « courgette/disassembler_elf_32_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698