- Timestamp:
- 12/17/10 21:38:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/make_array.java
r12431 r13096 142 142 } 143 143 final AbstractVector v; 144 final LispObject defaultInitialElement; 144 145 if (upgradedType == Symbol.CHARACTER) 145 146 { … … 148 149 else 149 150 v = new SimpleString(size); 151 defaultInitialElement = LispCharacter.getInstance('\0'); 150 152 } 151 153 else if (upgradedType == Symbol.BIT) … … 155 157 else 156 158 v = new SimpleBitVector(size); 159 defaultInitialElement = Fixnum.ZERO; 157 160 } 158 161 else if (upgradedType.equal(UNSIGNED_BYTE_8)) … … 162 165 else 163 166 v = new BasicVector_UnsignedByte8(size); 167 defaultInitialElement = Fixnum.ZERO; 164 168 } 165 169 else if (upgradedType.equal(UNSIGNED_BYTE_16) && … … 167 171 { 168 172 v = new BasicVector_UnsignedByte16(size); 173 defaultInitialElement = Fixnum.ZERO; 169 174 } 170 175 else if (upgradedType.equal(UNSIGNED_BYTE_32)) … … 174 179 else 175 180 v = new BasicVector_UnsignedByte32(size); 181 defaultInitialElement = Fixnum.ZERO; 176 182 } 177 183 else if (upgradedType == NIL) 178 v = new NilVector(size); 184 { 185 v = new NilVector(size); 186 defaultInitialElement = NIL; 187 } 179 188 else 180 189 { … … 183 192 else 184 193 v = new SimpleVector(size); 194 defaultInitialElement = NIL; 185 195 } 186 196 if (initialElementProvided != NIL) … … 208 218 return type_error(initialContents, Symbol.SEQUENCE); 209 219 } 220 else 221 { 222 v.fill(defaultInitialElement); 223 } 210 224 if (fillPointer != NIL) 211 225 v.setFillPointer(fillPointer); … … 227 241 if (initialElementProvided != NIL) 228 242 array.fill(initialElement); 243 else 244 array.fill(Fixnum.ZERO); 229 245 } 230 246 } … … 240 256 if (initialElementProvided != NIL) 241 257 array.fill(initialElement); 258 else 259 array.fill(Fixnum.ZERO); 242 260 } 243 261 } … … 253 271 if (initialElementProvided != NIL) 254 272 array.fill(initialElement); 273 else 274 array.fill(Fixnum.ZERO); 255 275 } 256 276 } … … 266 286 if (initialElementProvided != NIL) 267 287 array.fill(initialElement); 288 else 289 array.fill(NIL); 268 290 } 269 291 } … … 283 305 if (initialElementProvided != NIL) 284 306 array.fill(initialElement); 307 else 308 array.fill(Fixnum.ZERO); 285 309 } 286 310 } … … 296 320 if (initialElementProvided != NIL) 297 321 array.fill(initialElement); 322 else 323 array.fill(Fixnum.ZERO); 298 324 } 299 325 } … … 309 335 if (initialElementProvided != NIL) 310 336 array.fill(initialElement); 337 else 338 array.fill(NIL); 311 339 } 312 340 }
Note: See TracChangeset
for help on using the changeset viewer.