Closed Bug 754777 Opened 12 years ago Closed 12 years ago

B2G RIL: Add a Helper to read String delimiters

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: allstars.chh, Assigned: allstars.chh)

Details

Attachments

(1 file, 1 obsolete file)

In ril_worker.js,
there are many code snippets like

let delimiter = Buf.readUint16();
if (!(length & 1)) {
  delimiter |= Buf.readUint16();
}
if (DEBUG) {
  if (delimiter != 0) {
    debug("Something's wrong, found string delimiter: " + delimiter);
  }
}


Since it can be simplified as a function,
we should add a helper for this.
Assignee: nobody → yhuang
Comment on attachment 623601 [details] [diff] [review]
Patch to readStringDelimiter helper function

Review of attachment 623601 [details] [diff] [review]:
-----------------------------------------------------------------

Yay! But having this be a method on `GsmPDUHelper` doesn't make much sense. Let's put those methods on `Buf`.
Attachment #623601 - Flags: review?(philipp) → feedback+
Hi, Philikon
Thanks for that comment, yes, it makes much sense to add this helper in Buf.

Do I need to add r=philikon in this patch?

thanks
Attachment #623601 - Attachment is obsolete: true
Attachment #623914 - Flags: review?(philipp)
Attachment #623914 - Flags: review?(philipp) → review+
(In reply to Yoshi Huang[:yoshi] from comment #3)
> Do I need to add r=philikon in this patch?

In the future this would be helpful, yes. It saves me having to add it manually.

Thanks for the updated patch!
https://hg.mozilla.org/mozilla-central/rev/f03005c65982
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: