@@ -768,7 +768,7 @@ void sect_Skip(uint32_t skip, bool ds) {
768
768
}
769
769
770
770
// Output a byte that can be relocatable or constant
771
- void sect_RelByte (Expression &expr, uint32_t pcShift) {
771
+ void sect_RelByte (Expression const &expr, uint32_t pcShift) {
772
772
if (!requireCodeSection ()) {
773
773
return ;
774
774
}
@@ -782,15 +782,13 @@ void sect_RelByte(Expression &expr, uint32_t pcShift) {
782
782
}
783
783
784
784
// Output several bytes that can be relocatable or constant
785
- void sect_RelBytes (uint32_t n, std::vector<Expression> &exprs) {
785
+ void sect_RelBytes (uint32_t n, std::vector<Expression> const &exprs) {
786
786
if (!requireCodeSection ()) {
787
787
return ;
788
788
}
789
789
790
790
for (uint32_t i = 0 ; i < n; i++) {
791
- Expression &expr = exprs[i % exprs.size ()];
792
-
793
- if (!expr.isKnown ()) {
791
+ if (Expression const &expr = exprs[i % exprs.size ()]; !expr.isKnown ()) {
794
792
createPatch (PATCHTYPE_BYTE, expr, i);
795
793
writeByte (0 );
796
794
} else {
@@ -800,7 +798,7 @@ void sect_RelBytes(uint32_t n, std::vector<Expression> &exprs) {
800
798
}
801
799
802
800
// Output a word that can be relocatable or constant
803
- void sect_RelWord (Expression &expr, uint32_t pcShift) {
801
+ void sect_RelWord (Expression const &expr, uint32_t pcShift) {
804
802
if (!requireCodeSection ()) {
805
803
return ;
806
804
}
@@ -814,7 +812,7 @@ void sect_RelWord(Expression &expr, uint32_t pcShift) {
814
812
}
815
813
816
814
// Output a long that can be relocatable or constant
817
- void sect_RelLong (Expression &expr, uint32_t pcShift) {
815
+ void sect_RelLong (Expression const &expr, uint32_t pcShift) {
818
816
if (!requireCodeSection ()) {
819
817
return ;
820
818
}
@@ -828,7 +826,7 @@ void sect_RelLong(Expression &expr, uint32_t pcShift) {
828
826
}
829
827
830
828
// Output a PC-relative byte that can be relocatable or constant
831
- void sect_PCRelByte (Expression &expr, uint32_t pcShift) {
829
+ void sect_PCRelByte (Expression const &expr, uint32_t pcShift) {
832
830
if (!requireCodeSection ()) {
833
831
return ;
834
832
}
0 commit comments