@@ -109,11 +109,11 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType(
109109
110110 // No PackOffset info at all, or have a valid packoffset/register(c#)
111111 // annotations value -> layout the field.
112- int PO = PackOffsets ? (*PackOffsets)[Index++] : -1 ;
112+ const int PO = PackOffsets ? (*PackOffsets)[Index++] : -1 ;
113113 if (!PackOffsets || PO != -1 ) {
114114 if (!layoutField (FD, EndOffset, FieldOffset, FieldType, PO))
115115 return nullptr ;
116- Layout.push_back (( unsigned ) FieldOffset);
116+ Layout.push_back (FieldOffset);
117117 LayoutElements.push_back (FieldType);
118118 continue ;
119119 }
@@ -130,16 +130,16 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType(
130130 // process delayed layouts
131131 for (auto I : DelayLayoutFields) {
132132 const FieldDecl *FD = I.first ;
133- unsigned IndexInLayoutElements = I.second ;
133+ const unsigned IndexInLayoutElements = I.second ;
134134 // the first item in layout vector is size, so we need to offset the index
135135 // by 1
136- unsigned IndexInLayout = IndexInLayoutElements + 1 ;
136+ const unsigned IndexInLayout = IndexInLayoutElements + 1 ;
137137 assert (Layout[IndexInLayout] == UINT_MAX &&
138138 LayoutElements[IndexInLayoutElements] == nullptr );
139139
140140 if (!layoutField (FD, EndOffset, FieldOffset, FieldType))
141141 return nullptr ;
142- Layout[IndexInLayout] = ( unsigned ) FieldOffset;
142+ Layout[IndexInLayout] = FieldOffset;
143143 LayoutElements[IndexInLayoutElements] = FieldType;
144144 }
145145
0 commit comments