/[gnokii]/gnokii/common/phones/atgen.c
ViewVC logotype

Diff of /gnokii/common/phones/atgen.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.113 by pkot, Wed Jun 29 20:55:18 2005 UTC revision 1.114 by pkot, Sun Jul 31 21:27:44 2005 UTC
# Line 221  char *memorynames[] = { Line 221  char *memorynames[] = {
221          "CB", /* Currently selected memory */          "CB", /* Currently selected memory */
222  };  };
223    
224    #define NR_MEMORIES (sizeof (memorynames) / sizeof ((memorynames)[0]))
225    
226  typedef struct {  typedef struct {
227          char *str;          char *str;
228          at_charset charset;          at_charset charset;
# Line 508  gn_error at_memory_type_set(gn_memory_ty Line 510  gn_error at_memory_type_set(gn_memory_ty
510          gn_error ret = GN_ERR_NONE;          gn_error ret = GN_ERR_NONE;
511    
512          if (mt != drvinst->memorytype) {          if (mt != drvinst->memorytype) {
513                    if (mt >= NR_MEMORIES)
514                            return GN_ERR_INVALIDMEMORYTYPE;
515                  sprintf(req, "AT+CPBS=\"%s\"\r", memorynames[mt]);                  sprintf(req, "AT+CPBS=\"%s\"\r", memorynames[mt]);
516                  ret = sm_message_send(13, GN_OP_Init, req, state);                  ret = sm_message_send(13, GN_OP_Init, req, state);
517                  if (ret)                  if (ret)
# Line 1362  static gn_error ReplyGetSMSStatus(int me Line 1366  static gn_error ReplyGetSMSStatus(int me
1366          data->sms_status->folders_count = 0;          data->sms_status->folders_count = 0;
1367    
1368          data->sms_status->new_message_store = GN_MT_ME;          data->sms_status->new_message_store = GN_MT_ME;
1369          for (i = 0; i < sizeof(memorynames)/sizeof(char *); i++) {          for (i = 0; i < NR_MEMORIES; i++) {
1370                  if (strcmp(store, memorynames[i]) == 0) {                  if (strcmp(store, memorynames[i]) == 0) {
1371                          data->sms_status->new_message_store = i;                          data->sms_status->new_message_store = i;
1372                          break;                          break;

Legend:
Removed from v.1.113  
changed lines
  Added in v.1.114

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26