@@ -256,15 +256,15 @@ type buf_writer =
256
256
// FIXME: eventually u64
257
257
258
258
obj {
259
- fn write ( [ u8 ] ) ;
259
+ fn write ( [ const u8 ] ) ;
260
260
fn seek ( int , seek_style ) ;
261
261
fn tell ( ) -> uint ;
262
262
fn flush ( ) -> int ;
263
263
fn fsync ( level : fsync:: level ) -> int ;
264
264
} ;
265
265
266
266
obj FILE_writer ( f: os:: libc:: FILE , res: option:: t<@FILE_res >) {
267
- fn write ( v : [ u8 ] ) unsafe {
267
+ fn write ( v : [ const u8 ] ) unsafe {
268
268
let len = vec:: len :: < u8 > ( v) ;
269
269
let vbuf = vec:: unsafe:: to_ptr :: < u8 > ( v) ;
270
270
let nout = os:: libc:: fwrite ( vbuf, len, 1 u, f) ;
@@ -283,7 +283,7 @@ obj FILE_writer(f: os::libc::FILE, res: option::t<@FILE_res>) {
283
283
resource fd_res( fd: fd_t) { os:: libc:: close ( fd) ; }
284
284
285
285
obj fd_buf_writer( fd: fd_t, res: option:: t<@fd_res>) {
286
- fn write ( v : [ u8 ] ) unsafe {
286
+ fn write ( v : [ const u8 ] ) unsafe {
287
287
let len = vec:: len :: < u8 > ( v) ;
288
288
let count = 0 u;
289
289
let vbuf;
@@ -351,7 +351,7 @@ type writer =
351
351
fn write_char ( char ) ;
352
352
fn write_int ( int ) ;
353
353
fn write_uint ( uint ) ;
354
- fn write_bytes ( [ u8 ] ) ;
354
+ fn write_bytes ( [ const u8 ] ) ;
355
355
fn write_le_uint ( uint , uint ) ;
356
356
fn write_le_int ( int , uint ) ;
357
357
fn write_be_uint ( uint , uint ) ;
@@ -384,7 +384,7 @@ obj new_writer(out: buf_writer) {
384
384
}
385
385
fn write_int ( n : int ) { out. write ( str:: bytes ( int:: to_str ( n, 10 u) ) ) ; }
386
386
fn write_uint ( n : uint ) { out. write ( str:: bytes ( uint:: to_str ( n, 10 u) ) ) ; }
387
- fn write_bytes ( bytes : [ u8 ] ) { out. write ( bytes) ; }
387
+ fn write_bytes ( bytes : [ const u8 ] ) { out. write ( bytes) ; }
388
388
fn write_le_uint ( n : uint , size : uint ) {
389
389
out. write ( uint_to_le_bytes ( n, size) ) ;
390
390
}
@@ -435,7 +435,7 @@ type str_writer =
435
435
type mutable_byte_buf = @{ mutable buf: [ mutable u8] , mutable pos: uint } ;
436
436
437
437
obj byte_buf_writer ( buf: mutable_byte_buf) {
438
- fn write ( v : [ u8 ] ) {
438
+ fn write ( v : [ const u8 ] ) {
439
439
// Fast path.
440
440
441
441
if buf. pos == vec:: len ( buf. buf ) {
0 commit comments