• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision55644f59df13443b5058cf8f445925284600e36e (tree)
Zeit2019-06-16 22:31:40
AutorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

target/rx: simplify rx_cpu_class_by_name

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

Ändern Zusammenfassung

Diff

--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -72,9 +72,8 @@ static void rx_cpu_reset(CPUState *s)
7272 static void rx_cpu_list_entry(gpointer data, gpointer user_data)
7373 {
7474 const char *typename = object_class_get_name(OBJECT_CLASS(data));
75- int len = strlen(typename) - strlen(RX_CPU_TYPE_SUFFIX);
7675
77- qemu_printf("%.*s\n", len, typename);
76+ qemu_printf("%s\n", typename);
7877 }
7978
8079 void rx_cpu_list(void)
@@ -88,25 +87,12 @@ void rx_cpu_list(void)
8887 static ObjectClass *rx_cpu_class_by_name(const char *cpu_model)
8988 {
9089 ObjectClass *oc;
91- char *typename;
9290
9391 oc = object_class_by_name(cpu_model);
94- if (oc != NULL && object_class_dynamic_cast(oc, TYPE_RX_CPU) != NULL &&
95- !object_class_is_abstract(oc)) {
96- return oc;
97- }
98-
99- typename = g_strdup_printf(RX_CPU_TYPE_NAME("%s"), cpu_model);
100- oc = object_class_by_name(typename);
101- if (oc != NULL && object_class_is_abstract(oc)) {
92+ if (object_class_dynamic_cast(oc, TYPE_RX_CPU) == NULL ||
93+ object_class_is_abstract(oc)) {
10294 oc = NULL;
10395 }
104- g_free(typename);
105-
106- if (!oc) {
107- /* default to rx62n */
108- oc = object_class_by_name(TYPE_RX62N_CPU);
109- }
11096
11197 return oc;
11298 }