>-----Original Message----- >From: ofono-boun...@ofono.org [mailto:ofono-boun...@ofono.org] On Behalf Of >Marcel Holtmann >Sent: Monday, November 23, 2009 2:21 PM >To: ofono@ofono.org >Subject: RE: Patch on unsupported AT command > >Hi Yang, > >looks good so far, but ... > >> +static gboolean check_terminator(struct terminator_info *info, char >> *line) >> +{ >> + if ((info->len == -1 && !strcmp(line, info->terminator)) || >> + (info->len > 0 && !strncmp(line, info->terminator, >> info->len))) >> + return TRUE; >> + else >> + return FALSE; >> +} >> + > >This is first of all violating the coding style with the indentation on >the second line of the if, but it is also way too complicated. > > if (info->len == -1 && !strcmp(line, info->terminator) > return TRUE; > > if (info->len > 0 && !strncmp(line, info->terminator, ...)) > return TRUE; > > return FALSE; > >Maybe it is too early in the morning to do code review, but this should >be doing the same, but be a lot simpler to read ;)
You're absolutely right. In this way, the code is more readable. Please review again. > >Regards > >Marcel > > >_______________________________________________ >ofono mailing list >ofono@ofono.org >http://lists.ofono.org/listinfo/ofono
0001-Framework-to-support-non-standard-terminator.patch
Description: 0001-Framework-to-support-non-standard-terminator.patch
0002-Support-Huawei-specific-terminator.patch
Description: 0002-Support-Huawei-specific-terminator.patch
_______________________________________________ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono