@@ -39,13 +39,13 @@ void ClientCard::SetCode(unsigned int x) {
3939 code = x;
4040}
4141void ClientCard::UpdateInfo (unsigned char * buf) {
42- int flag = BufferIO::ReadInt32 (buf);
42+ int flag = BufferIO::Read< int32_t > (buf);
4343 if (flag == 0 ) {
4444 ClearData ();
4545 return ;
4646 }
4747 if (flag & QUERY_CODE ) {
48- int pdata = BufferIO::ReadInt32 (buf);
48+ int pdata = BufferIO::Read< int32_t > (buf);
4949 if (!pdata)
5050 ClearData ();
5151 if ((location == LOCATION_HAND ) && ((unsigned int )pdata != code)) {
@@ -55,45 +55,45 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
5555 code = pdata;
5656 }
5757 if (flag & QUERY_POSITION ) {
58- int pdata = (BufferIO::ReadInt32 (buf) >> 24 ) & 0xff ;
58+ int pdata = (BufferIO::Read< int32_t > (buf) >> 24 ) & 0xff ;
5959 if ((location & (LOCATION_EXTRA | LOCATION_REMOVED )) && pdata != position) {
6060 position = pdata;
6161 mainGame->dField .MoveCard (this , 1 );
6262 } else
6363 position = pdata;
6464 }
6565 if (flag & QUERY_ALIAS )
66- alias = BufferIO::ReadInt32 (buf);
66+ alias = BufferIO::Read< int32_t > (buf);
6767 if (flag & QUERY_TYPE )
68- type = BufferIO::ReadInt32 (buf);
68+ type = BufferIO::Read< int32_t > (buf);
6969 if (flag & QUERY_LEVEL ) {
70- int pdata = BufferIO::ReadInt32 (buf);
70+ int pdata = BufferIO::Read< int32_t > (buf);
7171 if (level != (unsigned int )pdata) {
7272 level = pdata;
7373 myswprintf (lvstring, L" L%d" , level);
7474 }
7575 }
7676 if (flag & QUERY_RANK ) {
77- int pdata = BufferIO::ReadInt32 (buf);
77+ int pdata = BufferIO::Read< int32_t > (buf);
7878 if (pdata && rank != (unsigned int )pdata) {
7979 rank = pdata;
8080 myswprintf (lvstring, L" R%d" , rank);
8181 }
8282 }
8383 if (flag & QUERY_ATTRIBUTE )
84- attribute = BufferIO::ReadInt32 (buf);
84+ attribute = BufferIO::Read< int32_t > (buf);
8585 if (flag & QUERY_RACE )
86- race = BufferIO::ReadInt32 (buf);
86+ race = BufferIO::Read< int32_t > (buf);
8787 if (flag & QUERY_ATTACK ) {
88- attack = BufferIO::ReadInt32 (buf);
88+ attack = BufferIO::Read< int32_t > (buf);
8989 if (attack < 0 ) {
9090 atkstring[0 ] = ' ?' ;
9191 atkstring[1 ] = 0 ;
9292 } else
9393 myswprintf (atkstring, L" %d" , attack);
9494 }
9595 if (flag & QUERY_DEFENSE ) {
96- defense = BufferIO::ReadInt32 (buf);
96+ defense = BufferIO::Read< int32_t > (buf);
9797 if (type & TYPE_LINK ) {
9898 defstring[0 ] = ' -' ;
9999 defstring[1 ] = 0 ;
@@ -104,31 +104,31 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
104104 myswprintf (defstring, L" %d" , defense);
105105 }
106106 if (flag & QUERY_BASE_ATTACK )
107- base_attack = BufferIO::ReadInt32 (buf);
107+ base_attack = BufferIO::Read< int32_t > (buf);
108108 if (flag & QUERY_BASE_DEFENSE )
109- base_defense = BufferIO::ReadInt32 (buf);
109+ base_defense = BufferIO::Read< int32_t > (buf);
110110 if (flag & QUERY_REASON )
111- reason = BufferIO::ReadInt32 (buf);
111+ reason = BufferIO::Read< int32_t > (buf);
112112 if (flag & QUERY_REASON_CARD )
113113 buf += 4 ;
114114 if (flag & QUERY_EQUIP_CARD ) {
115- int c = BufferIO::ReadUInt8 (buf);
116- unsigned int l = BufferIO::ReadUInt8 (buf);
117- int s = BufferIO::ReadUInt8 (buf);
118- BufferIO::ReadUInt8 (buf);
115+ int c = BufferIO::Read< uint8_t > (buf);
116+ unsigned int l = BufferIO::Read< uint8_t > (buf);
117+ int s = BufferIO::Read< uint8_t > (buf);
118+ BufferIO::Read< uint8_t > (buf);
119119 ClientCard* ecard = mainGame->dField .GetCard (mainGame->LocalPlayer (c), l, s);
120120 if (ecard) {
121121 equipTarget = ecard;
122122 ecard->equipped .insert (this );
123123 }
124124 }
125125 if (flag & QUERY_TARGET_CARD ) {
126- int count = BufferIO::ReadInt32 (buf);
126+ int count = BufferIO::Read< int32_t > (buf);
127127 for (int i = 0 ; i < count; ++i) {
128- int c = BufferIO::ReadUInt8 (buf);
129- unsigned int l = BufferIO::ReadUInt8 (buf);
130- int s = BufferIO::ReadUInt8 (buf);
131- BufferIO::ReadUInt8 (buf);
128+ int c = BufferIO::Read< uint8_t > (buf);
129+ unsigned int l = BufferIO::Read< uint8_t > (buf);
130+ int s = BufferIO::Read< uint8_t > (buf);
131+ BufferIO::Read< uint8_t > (buf);
132132 ClientCard* tcard = mainGame->dField .GetCard (mainGame->LocalPlayer (c), l, s);
133133 if (tcard) {
134134 cardTarget.insert (tcard);
@@ -137,38 +137,38 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
137137 }
138138 }
139139 if (flag & QUERY_OVERLAY_CARD ) {
140- int count = BufferIO::ReadInt32 (buf);
140+ int count = BufferIO::Read< int32_t > (buf);
141141 for (int i = 0 ; i < count; ++i) {
142- overlayed[i]->SetCode (BufferIO::ReadInt32 (buf));
142+ overlayed[i]->SetCode (BufferIO::Read< int32_t > (buf));
143143 }
144144 }
145145 if (flag & QUERY_COUNTERS ) {
146- int count = BufferIO::ReadInt32 (buf);
146+ int count = BufferIO::Read< int32_t > (buf);
147147 for (int i = 0 ; i < count; ++i) {
148- int ctype = BufferIO::ReadInt16 (buf);
149- int ccount = BufferIO::ReadInt16 (buf);
148+ int ctype = BufferIO::Read< uint16_t > (buf);
149+ int ccount = BufferIO::Read< uint16_t > (buf);
150150 counters[ctype] = ccount;
151151 }
152152 }
153153 if (flag & QUERY_OWNER )
154- owner = BufferIO::ReadInt32 (buf);
154+ owner = BufferIO::Read< int32_t > (buf);
155155 if (flag & QUERY_STATUS )
156- status = BufferIO::ReadInt32 (buf);
156+ status = BufferIO::Read< int32_t > (buf);
157157 if (flag & QUERY_LSCALE ) {
158- lscale = BufferIO::ReadInt32 (buf);
158+ lscale = BufferIO::Read< int32_t > (buf);
159159 myswprintf (lscstring, L" %d" , lscale);
160160 }
161161 if (flag & QUERY_RSCALE ) {
162- rscale = BufferIO::ReadInt32 (buf);
162+ rscale = BufferIO::Read< int32_t > (buf);
163163 myswprintf (rscstring, L" %d" , rscale);
164164 }
165165 if (flag & QUERY_LINK ) {
166- int pdata = BufferIO::ReadInt32 (buf);
166+ int pdata = BufferIO::Read< int32_t > (buf);
167167 if (link != (unsigned int )pdata) {
168168 link = pdata;
169169 }
170170 myswprintf (linkstring, L" L\x2012 %d" , link);
171- pdata = BufferIO::ReadInt32 (buf);
171+ pdata = BufferIO::Read< int32_t > (buf);
172172 if (link_marker != (unsigned int )pdata) {
173173 link_marker = pdata;
174174 }
0 commit comments