Previous 15994 Revisions Next

r15672 Wednesday 25th July, 2012 at 19:59:32 UTC by Firewave
removed unnecessary strlen() usage (no whatsnew)
[src/emu]clifront.c crsshair.c diimage.c dislot.c input.c mconfig.c uimain.c validity.c
[src/emu/cpu/tms32051]dis32051.c
[src/mame/audio]gorf.c wow.c

src/mame/audio/gorf.c
r15671r15672
136136
137137   /* Phoneme to word translation */
138138
139   if (strlen(state->m_totalword) == 0) {
139   if (*(state->m_totalword) == 0) {
140140      strcpy(state->m_totalword,PhonemeTable[Phoneme]);                      /* Copy over the first phoneme */
141141      if (state->m_plural != 0) {
142142         logerror("found a possible plural at %d\n",state->m_plural-1);
src/mame/audio/wow.c
r15671r15672
129129
130130   /* Phoneme to word translation */
131131
132   if (strlen(state->m_totalword) == 0) {
132   if (*(state->m_totalword) == 0) {
133133      strcpy(state->m_totalword,PhonemeTable[Phoneme]);                      /* Copy over the first phoneme */
134134      if (state->m_plural != 0) {
135135         //logerror("found a possible plural at %d\n",state->m_plural-1);
src/emu/cpu/tms32051/dis32051.c
r15671r15672
462462
463463         print("bcnd    %04X", FETCH());
464464
465         if (strlen(zl_condition_codes[zl]) > 0)
465         if (*(zl_condition_codes[zl]) != 0)
466466         {
467467            print(", %s", zl_condition_codes[zl]);
468468         }
469         if (strlen(cv_condition_codes[cv]) > 0)
469         if (*(cv_condition_codes[cv]) != 0)
470470         {
471471            print(", %s", cv_condition_codes[cv]);
472472         }
473         if (strlen(tp_condition_codes[tp]) > 0)
473         if (*(tp_condition_codes[tp]) != 0)
474474         {
475475            print(", %s", tp_condition_codes[tp]);
476476         }
r15671r15672
489489
490490         print("xc      %d", n);
491491
492         if (strlen(zl_condition_codes[zl]) > 0)
492         if (*(zl_condition_codes[zl]) != 0)
493493         {
494494            print(", %s", zl_condition_codes[zl]);
495495         }
496         if (strlen(cv_condition_codes[cv]) > 0)
496         if (*(cv_condition_codes[cv]) != 0)
497497         {
498498            print(", %s", cv_condition_codes[cv]);
499499         }
500         if (strlen(tp_condition_codes[tp]) > 0)
500         if (*(tp_condition_codes[tp]) != 0)
501501         {
502502            print(", %s", tp_condition_codes[tp]);
503503         }
r15671r15672
514514
515515         print("cc      %04X", FETCH());
516516
517         if (strlen(zl_condition_codes[zl]) > 0)
517         if (*(zl_condition_codes[zl]) != 0)
518518         {
519519            print(", %s", zl_condition_codes[zl]);
520520         }
521         if (strlen(cv_condition_codes[cv]) > 0)
521         if (*(cv_condition_codes[cv]) != 0)
522522         {
523523            print(", %s", cv_condition_codes[cv]);
524524         }
525         if (strlen(tp_condition_codes[tp]) > 0)
525         if (*(tp_condition_codes[tp]) != 0)
526526         {
527527            print(", %s", tp_condition_codes[tp]);
528528         }
r15671r15672
539539
540540         print("retc    ");
541541
542         if (strlen(zl_condition_codes[zl]) > 0)
542         if (*(zl_condition_codes[zl]) != 0)
543543         {
544544            print(", %s", zl_condition_codes[zl]);
545545         }
546         if (strlen(cv_condition_codes[cv]) > 0)
546         if (*(cv_condition_codes[cv]) != 0)
547547         {
548548            print(", %s", cv_condition_codes[cv]);
549549         }
550         if (strlen(tp_condition_codes[tp]) > 0)
550         if (*(tp_condition_codes[tp]) != 0)
551551         {
552552            print(", %s", tp_condition_codes[tp]);
553553         }
r15671r15672
567567
568568         print("bcndd   %04X", FETCH());
569569
570         if (strlen(zl_condition_codes[zl]) > 0)
570         if (*(zl_condition_codes[zl]) != 0)
571571         {
572572            print(", %s", zl_condition_codes[zl]);
573573         }
574         if (strlen(cv_condition_codes[cv]) > 0)
574         if (*(cv_condition_codes[cv]) != 0)
575575         {
576576            print(", %s", cv_condition_codes[cv]);
577577         }
578         if (strlen(tp_condition_codes[tp]) > 0)
578         if (*(tp_condition_codes[tp]) != 0)
579579         {
580580            print(", %s", tp_condition_codes[tp]);
581581         }
r15671r15672
592592
593593         print("ccd     %04X", FETCH());
594594
595         if (strlen(zl_condition_codes[zl]) > 0)
595         if (*(zl_condition_codes[zl]) != 0)
596596         {
597597            print(", %s", zl_condition_codes[zl]);
598598         }
599         if (strlen(cv_condition_codes[cv]) > 0)
599         if (*(cv_condition_codes[cv]) != 0)
600600         {
601601            print(", %s", cv_condition_codes[cv]);
602602         }
603         if (strlen(tp_condition_codes[tp]) > 0)
603         if (*(tp_condition_codes[tp]) != 0)
604604         {
605605            print(", %s", tp_condition_codes[tp]);
606606         }
r15671r15672
617617
618618         print("retcd   ");
619619
620         if (strlen(zl_condition_codes[zl]) > 0)
620         if (*(zl_condition_codes[zl]) != 0)
621621         {
622622            print(", %s", zl_condition_codes[zl]);
623623         }
624         if (strlen(cv_condition_codes[cv]) > 0)
624         if (*(cv_condition_codes[cv]) != 0)
625625         {
626626            print(", %s", cv_condition_codes[cv]);
627627         }
628         if (strlen(tp_condition_codes[tp]) > 0)
628         if (*(tp_condition_codes[tp]) != 0)
629629         {
630630            print(", %s", tp_condition_codes[tp]);
631631         }
src/emu/diimage.c
r15671r15672
980980bool device_image_interface::open_image_file(emu_options &options)
981981{
982982   const char* path = options.value(instance_name());
983   if (strlen(path)>0)
983   if (*path != 0)
984984   {
985985      set_init_phase();
986986      if (load_internal(path, FALSE, 0, NULL, TRUE)==IMAGE_INIT_PASS)
src/emu/crsshair.c
r15671r15672
507507            }
508508
509509            /* the default graphic name is "", so only save if not */
510            if (strlen(global.name[player]) > 0)
510            if (*(global.name[player]) != 0)
511511            {
512512               xml_set_attribute(crosshairnode, "pic", global.name[player]);
513513               changed = TRUE;
src/emu/clifront.c
r15671r15672
154154      // first parse options to be able to get software from it
155155      astring option_errors;
156156      m_options.parse_command_line(argc, argv, option_errors);
157      if (strlen(m_options.software_name()) > 0)
157      if (*(m_options.software_name()) != 0)
158158      {
159159         const game_driver *system = m_options.system();
160         if (system == NULL && strlen(m_options.system_name()) > 0)
160         if (system == NULL && *(m_options.system_name()) != 0)
161161            throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
162162
163163         machine_config config(*system, m_options);
r15671r15672
193193                                 {
194194                                    const char *option = m_options.value(image->brief_instance_name());
195195                                    // mount only if not already mounted
196                                    if (strlen(option) == 0)
196                                    if (*option == 0)
197197                                    {
198198                                       astring val;
199199                                       val.printf("%s:%s:%s",swlist->list_name(),m_options.software_name(),swpart->name);
r15671r15672
224224      if (!m_options.parse_command_line(argc, argv, option_errors))
225225      {
226226         // if we failed, check for no command and a system name first; in that case error on the name
227         if (strlen(m_options.command()) == 0 && m_options.system() == NULL && strlen(m_options.system_name()) > 0)
227         if (*(m_options.command()) == 0 && m_options.system() == NULL && *(m_options.system_name()) != 0)
228228            throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
229229
230230         // otherwise, error on the options
r15671r15672
238238      core_filename_extract_base(exename, argv[0], true);
239239
240240      // if we have a command, execute that
241      if (strlen(m_options.command()) != 0)
241      if (*(m_options.command()) != 0)
242242         execute_commands(exename);
243243
244244      // otherwise, check for a valid system
r15671r15672
246246      {
247247         // if we can't find it, give an appropriate error
248248         const game_driver *system = m_options.system();
249         if (system == NULL && strlen(m_options.system_name()) > 0)
249         if (system == NULL && *(m_options.system_name()) != 0)
250250            throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
251251         // otherwise just run the game
252252         m_result = mame_execute(m_options, m_osd);
r15671r15672
262262
263263      // if a game was specified, wasn't a wildcard, and our error indicates this was the
264264      // reason for failure, offer some suggestions
265      if (m_result == MAMERR_NO_SUCH_GAME && strlen(m_options.system_name()) > 0 && strchr(m_options.system_name(), '*') == NULL && m_options.system() == NULL)
265      if (m_result == MAMERR_NO_SUCH_GAME && *(m_options.system_name()) != 0 && strchr(m_options.system_name(), '*') == NULL && m_options.system() == NULL)
266266      {
267267         // get the top 10 approximate matches
268268         driver_enumerator drivlist(m_options);
r15671r15672
806806      device_iterator iter(config.root_device());
807807      for (device_t *dev = iter.first(); dev != NULL; dev = iter.next())
808808      {
809         if (dev->owner() != NULL && (strlen(dev->shortname())>0) && dev->rom_region() != NULL && (device_map.add(dev->shortname(), 0, false) != TMERR_DUPLICATE)) {
809         if (dev->owner() != NULL && (*(dev->shortname()) != 0) && dev->rom_region() != NULL && (device_map.add(dev->shortname(), 0, false) != TMERR_DUPLICATE)) {
810810            if (mame_strwildcmp(gamename, dev->shortname()) == 0)
811811            {
812812               matched++;
src/emu/uimain.c
r15671r15672
23832383         int found = false;
23842384
23852385         /* if we are using the default, then we just need to find the first in the list */
2386         if (strlen(settings.name) == 0)
2386         if (*(settings.name) == 0)
23872387            using_default = true;
23882388
23892389         /* look for the current name, then remember the name before */
src/emu/validity.c
r15671r15672
132132      begin += 1;
133133
134134   // 0-length = bad
135   if (strlen(begin) == 0)
135   if (*begin == 0)
136136      mame_printf_error("Found 0-length tag\n");
137137
138138   // too short/too long = bad
src/emu/dislot.c
r15671r15672
4343   } else {
4444      subtag = device().mconfig().options().value(device().tag()+1);
4545   }
46   if (subtag && strlen(subtag)>0) {
46   if (subtag && *subtag != 0) {
4747      device_slot_card_interface *intf = NULL;
4848      dev = device().subdevice(subtag);
4949      if (dev!=NULL && !dev->interface(intf))
src/emu/input.c
r15671r15672
20022002   {
20032003      // if this is a code item which is not valid, don't copy it and remove any preceding ORs/NOTs
20042004      input_code code = seq[codenum];
2005      if (!code.internal() && strlen(code_name(codestr, code)) == 0)
2005      if (!code.internal() && *(code_name(codestr, code)) == 0)
20062006      {
20072007         while (clean_index > 0 && clean_codes[clean_index - 1].internal())
20082008            clean_index--;
src/emu/mconfig.c
r15671r15672
8282         if (!is_selected_driver || !options.exists(owner.tag()+1))
8383            selval = slot->get_default_card();
8484
85         if (selval != NULL && strlen(selval) != 0)
85         if (selval != NULL && *selval != 0)
8686         {
8787            bool found = false;
8888            for (int i = 0; intf[i].name != NULL; i++)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team