Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: utils/archive/utils.dart

Issue 11312122: Change List constructors. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload. Adapt code for List.fixedLength. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/tls_socket_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library utils; 5 library utils;
6 6
7 import 'dart-ext:dart_archive'; 7 import 'dart-ext:dart_archive';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 import 'archive.dart' as archive; 9 import 'archive.dart' as archive;
10 10
(...skipping 27 matching lines...) Expand all
38 var errno = response[1]; 38 var errno = response[1];
39 var message = response[2]; 39 var message = response[2];
40 40
41 if (!success) throw new ArchiveException(message, errno); 41 if (!success) throw new ArchiveException(message, errno);
42 return message; 42 return message;
43 }); 43 });
44 } 44 }
45 45
46 /** Converts [input] to a fixed-length list which C can understand. */ 46 /** Converts [input] to a fixed-length list which C can understand. */
47 List listForC(List input) { 47 List listForC(List input) {
48 var list = new List(input.length); 48 var list = new List.fixedLength(input.length);
49 list.setRange(0, input.length, input); 49 list.setRange(0, input.length, input);
50 return list; 50 return list;
51 } 51 }
52 52
53 /** Converts [input] to a [Uint8List] that C can process easily. */ 53 /** Converts [input] to a [Uint8List] that C can process easily. */
54 Uint8List bytesForC(List<int> input) { 54 Uint8List bytesForC(List<int> input) {
55 var list = new Uint8List(input.length); 55 var list = new Uint8List(input.length);
56 list.setRange(0, input.length, input); 56 list.setRange(0, input.length, input);
57 return list; 57 return list;
58 } 58 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 /** The error code for the error, or null. */ 103 /** The error code for the error, or null. */
104 final int errno; 104 final int errno;
105 105
106 ArchiveException(this.message, [this.errno]); 106 ArchiveException(this.message, [this.errno]);
107 107
108 String toString() { 108 String toString() {
109 if (errno == null) return "Archive error: $message"; 109 if (errno == null) return "Archive error: $message";
110 return "Archive error $errno: $message"; 110 return "Archive error $errno: $message";
111 } 111 }
112 } 112 }
OLDNEW
« no previous file with comments | « tests/standalone/io/tls_socket_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698