Skip to content
Browse files

Minor cleanups for core/ui Makefile separation.

This patch contains minor cleanups that will be needed by
a few future patches that will improve the way core and ui
sources are separated and built.

- remove a few compiler warnings
- formatting
- remove the memcheck CONFIG_MEMCHECK checks (they later get in the way)
- refine hw/hw.h inclusion's of cpu.h (this comes from upstream)
- add missing definitions for PRUd64 and PRUx64 (used later)
- remove CONFIG_SHAPER test, replace with CONFIG_ANDROID instead.
- add missing strdup() calls.

Change-Id: Ic7d6681a51af718c298f0ee4bd884b1d8750f28e
  • Loading branch information...
1 parent fa59e01 commit 462564f31bbdc9939bf1d2376e2782defa7ef655 @digit-android digit-android committed Feb 23, 2011
View
4 android/main-ui.c
@@ -442,7 +442,7 @@ int main(int argc, char **argv)
opts->no_skin = opts->noskin;
/* Parses options and builds an appropriate AVD. */
- avd = android_avdInfo = createAVD(opts, &inAndroidBuild) ;
+ avd = android_avdInfo = createAVD(opts, &inAndroidBuild);
/* get the skin from the virtual device configuration */
opts->skin = (char*) avdInfo_getSkinName( avd );
@@ -1015,7 +1015,7 @@ int main(int argc, char **argv)
#endif
args[n++] = "-android-avdname";
- args[n++] = avdInfo_getName(avd);
+ args[n++] = (char*) avdInfo_getName(avd);
/* Set up the interfaces for inter-emulator networking */
if (opts->shared_net_id) {
View
4 android/main.c
@@ -233,7 +233,7 @@ int main(int argc, char **argv)
opts->no_skin = opts->noskin;
/* Parses options and builds an appropriate AVD. */
- avd = android_avdInfo = createAVD(opts, &inAndroidBuild) ;
+ avd = android_avdInfo = createAVD(opts, &inAndroidBuild);
/* get the skin from the virtual device configuration */
opts->skin = (char*) avdInfo_getSkinName( avd );
@@ -810,7 +810,7 @@ int main(int argc, char **argv)
#endif
args[n++] = "-android-avdname";
- args[n++] = avdInfo_getName(avd);
+ args[n++] = (char*) avdInfo_getName(avd);
/* Set up the interfaces for inter-emulator networking */
if (opts->shared_net_id) {
View
6 android/utils/system.h
@@ -173,6 +173,12 @@ extern void sleep_ms( int timeout );
#ifndef PRIx64
# define PRIx64 "llx"
#endif
+#ifndef PRUd64
+# define PRUd64 "llu"
+#endif
+#ifndef PRUx64
+# define PRUx64 "llx"
+#endif
/* */
View
3 hw/hw.h
@@ -4,7 +4,10 @@
#include "qemu-common.h"
#include "irq.h"
+
+#if defined(TARGET_PHYS_ADDRESS_SPACE_BITS) && !defined(NEED_CPU_H)
#include "cpu.h"
+#endif
/* VM Load/Save */
View
6 memcheck/memcheck.c
@@ -14,12 +14,6 @@
* Contains implementation of memory checking framework in the emulator.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-queue.h"
#include "qemu_file.h"
#include "elff_api.h"
View
6 memcheck/memcheck.h
@@ -18,12 +18,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_H
#define QEMU_MEMCHECK_MEMCHECK_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_common.h"
#ifdef __cplusplus
View
6 memcheck/memcheck_common.h
@@ -18,12 +18,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_COMMON_H
#define QEMU_MEMCHECK_MEMCHECK_COMMON_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-common.h"
#include "cpu.h"
View
6 memcheck/memcheck_logging.h
@@ -17,12 +17,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_LOGGING_H
#define QEMU_MEMCHECK_MEMCHECK_LOGGING_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-common.h"
#include "android/utils/debug.h"
View
6 memcheck/memcheck_malloc_map.c
@@ -15,12 +15,6 @@
* memory blocks allocated by the guest system.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_malloc_map.h"
#include "memcheck_util.h"
#include "memcheck_logging.h"
View
6 memcheck/memcheck_malloc_map.h
@@ -24,12 +24,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_MALLOC_MAP_H
#define QEMU_MEMCHECK_MEMCHECK_MALLOC_MAP_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "sys-tree.h"
#include "memcheck_common.h"
View
6 memcheck/memcheck_mmrange_map.c
@@ -15,12 +15,6 @@
* memory mappings in the guest system.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_mmrange_map.h"
#include "memcheck_logging.h"
View
6 memcheck/memcheck_mmrange_map.h
@@ -22,12 +22,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_MMRANGE_MAP_H
#define QEMU_MEMCHECK_MEMCHECK_MMRANGE_MAP_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "sys-tree.h"
#include "memcheck_common.h"
View
6 memcheck/memcheck_proc_management.c
@@ -15,12 +15,6 @@
* memchecker framework.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "elff/elff_api.h"
#include "memcheck.h"
#include "memcheck_proc_management.h"
View
6 memcheck/memcheck_proc_management.h
@@ -18,12 +18,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_PROC_MANAGEMENT_H
#define QEMU_MEMCHECK_MEMCHECK_PROC_MANAGEMENT_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-queue.h"
#include "memcheck_common.h"
#include "memcheck_malloc_map.h"
View
6 memcheck/memcheck_util.c
@@ -14,12 +14,6 @@
* Contains implementation of utility routines for memchecker framework.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "stdio.h"
#include "qemu-common.h"
#include "android/utils/path.h"
View
6 memcheck/memcheck_util.h
@@ -17,12 +17,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_UTIL_H
#define QEMU_MEMCHECK_MEMCHECK_UTIL_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_common.h"
#include "elff/elff_api.h"
View
12 net-android.c
@@ -126,7 +126,7 @@
#include "libslirp.h"
#endif
-#if defined(CONFIG_SHAPER)
+#if defined(CONFIG_ANDROID)
#include "shaper.h"
#endif
@@ -730,7 +730,7 @@ ip_packet_is_internal( const uint8_t* data, size_t size )
return ( data[12] == 10 && data[16] == 10);
}
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
NetShaper slirp_shaper_in;
NetShaper slirp_shaper_out;
@@ -773,12 +773,12 @@ slirp_init_shapers( void )
netshaper_set_rate( slirp_shaper_in, qemu_net_upload_speed );
}
-#endif /* CONFIG_SHAPER */
+#endif /* CONFIG_ANDROID */
int slirp_can_output(void)
{
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
return !slirp_vc ||
( netshaper_can_send(slirp_shaper_out) &&
qemu_can_send_packet(slirp_vc) );
@@ -799,7 +799,7 @@ void slirp_output(const uint8_t *pkt, int pkt_len)
if (!slirp_vc)
return;
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
netshaper_send(slirp_shaper_out, (void*)pkt, pkt_len);
#else
qemu_send_packet(slirp_vc, pkt, pkt_len);
@@ -820,7 +820,7 @@ static ssize_t slirp_receive(VLANClientState *vc, const uint8_t *buf, size_t siz
if (qemu_tcpdump_active)
qemu_tcpdump_packet(buf, size);
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
netshaper_send(slirp_shaper_in, (char*)buf, size);
#else
slirp_input(buf, size);
View
4 target-arm/helper.c
@@ -1214,7 +1214,7 @@ static inline int get_phys_addr(CPUState *env, uint32_t address,
int cpu_arm_handle_mmu_fault (CPUState *env, target_ulong address,
int access_type, int mmu_idx, int is_softmmu)
{
- uint32_t phys_addr;
+ uint32_t phys_addr = 0;
int prot;
int ret, is_user;
@@ -1244,7 +1244,7 @@ int cpu_arm_handle_mmu_fault (CPUState *env, target_ulong address,
target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
{
- uint32_t phys_addr;
+ uint32_t phys_addr = 0;
int prot;
int ret;
View
4 target-i386/cpu.h
@@ -181,7 +181,7 @@
#define HF2_VINTR_SHIFT 3 /* value of V_INTR_MASKING bit */
#define HF2_GIF_MASK (1 << HF2_GIF_SHIFT)
-#define HF2_HIF_MASK (1 << HF2_HIF_SHIFT)
+#define HF2_HIF_MASK (1 << HF2_HIF_SHIFT)
#define HF2_NMI_MASK (1 << HF2_NMI_SHIFT)
#define HF2_VINTR_MASK (1 << HF2_VINTR_SHIFT)
@@ -409,7 +409,7 @@
#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */
#define CPUID_VENDOR_AMD_1 0x68747541 /* "Auth" */
-#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */
+#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */
#define CPUID_VENDOR_AMD_3 0x444d4163 /* "cAMD" */
#define CPUID_MWAIT_IBE (1 << 1) /* Interrupts can exit capability */

0 comments on commit 462564f

Please sign in to comment.
Something went wrong with that request. Please try again.