mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Removed compiler warnings
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14979 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -3,6 +3,9 @@
|
|||||||
#include <proto/exec.h>
|
#include <proto/exec.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
|
void __mcount(uint32 frompc, uint32 selfpc);
|
||||||
|
|
||||||
void
|
void
|
||||||
__mcount(uint32 frompc, uint32 selfpc)
|
__mcount(uint32 frompc, uint32 selfpc)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,7 +12,11 @@
|
|||||||
#undef DebugPrintF
|
#undef DebugPrintF
|
||||||
#define dprintf(format, args...)((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF("[%s] " format, __PRETTY_FUNCTION__ , ## args)
|
#define dprintf(format, args...)((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF("[%s] " format, __PRETTY_FUNCTION__ , ## args)
|
||||||
|
|
||||||
struct gmonparam _gmonparam = {kGmonProfOn};
|
struct gmonparam _gmonparam =
|
||||||
|
{
|
||||||
|
state: kGmonProfOn
|
||||||
|
};
|
||||||
|
|
||||||
static unsigned int s_scale;
|
static unsigned int s_scale;
|
||||||
|
|
||||||
void moncontrol(int);
|
void moncontrol(int);
|
||||||
@ -269,6 +273,9 @@ out:
|
|||||||
|
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
|
int __profiler_init(void) __attribute__((constructor));
|
||||||
|
void __profiler_exit(void) __attribute__((destructor));
|
||||||
|
|
||||||
int __profiler_init(void)
|
int __profiler_init(void)
|
||||||
{
|
{
|
||||||
monstartup(0,0);
|
monstartup(0,0);
|
||||||
|
|||||||
@ -33,3 +33,4 @@ _mcount:
|
|||||||
bctr
|
bctr
|
||||||
_mcount_end:
|
_mcount_end:
|
||||||
.size _mcount,_mcount_end-_mcount
|
.size _mcount,_mcount_end-_mcount
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
#include <proto/exec.h>
|
#include <proto/exec.h>
|
||||||
#include <proto/performancemonitor.h>
|
|
||||||
#include <exec/interrupts.h>
|
#include <exec/interrupts.h>
|
||||||
|
#include <interfaces/performancemonitor.h>
|
||||||
|
#include <resources/performancemonitor.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
static struct PerformanceMonitorIFace *IPM;
|
|
||||||
static struct Interrupt CounterInt;
|
static struct Interrupt CounterInt;
|
||||||
|
static struct PerformanceMonitorIFace *IPM;
|
||||||
#undef DebugPrintF
|
|
||||||
#define dprintf(format, args...)((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF("[%s] " format, __PRETTY_FUNCTION__ , ## args)
|
|
||||||
|
|
||||||
static struct IntData
|
static struct IntData
|
||||||
{
|
{
|
||||||
@ -18,6 +17,9 @@ static struct IntData
|
|||||||
uint32 CounterStart;
|
uint32 CounterStart;
|
||||||
} ProfileData;
|
} ProfileData;
|
||||||
|
|
||||||
|
uint32 GetCounterStart(void);
|
||||||
|
uint32 CounterIntFn(struct ExceptionContext *, struct ExecBase *, struct IntData *);
|
||||||
|
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
GetCounterStart(void)
|
GetCounterStart(void)
|
||||||
@ -42,7 +44,11 @@ CounterIntFn(struct ExceptionContext *ctx, struct ExecBase *ExecBase,
|
|||||||
struct IntData *ProfileData)
|
struct IntData *ProfileData)
|
||||||
{
|
{
|
||||||
uint32 sia = (uint32)ProfileData->IPM->GetSampledAddress();
|
uint32 sia = (uint32)ProfileData->IPM->GetSampledAddress();
|
||||||
dprintf(".\n");
|
|
||||||
|
/* Silence compiler */
|
||||||
|
(void)ExecBase;
|
||||||
|
(void)ctx;
|
||||||
|
|
||||||
sia = ((sia - ProfileData->Offset) * ProfileData->Scale) >> 16;
|
sia = ((sia - ProfileData->Offset) * ProfileData->Scale) >> 16;
|
||||||
|
|
||||||
if (sia <= (ProfileData->BufferSize>>1))
|
if (sia <= (ProfileData->BufferSize>>1))
|
||||||
@ -58,7 +64,7 @@ CounterIntFn(struct ExceptionContext *ctx, struct ExecBase *ExecBase,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
profil(uint16 *buffer, uint32 bufSize, uint32 offset, uint32 scale)
|
profil(unsigned short *buffer, size_t bufSize, size_t offset, unsigned int scale)
|
||||||
{
|
{
|
||||||
APTR Stack;
|
APTR Stack;
|
||||||
|
|
||||||
@ -83,7 +89,6 @@ profil(uint16 *buffer, uint32 bufSize, uint32 offset, uint32 scale)
|
|||||||
|
|
||||||
if (!IPM || IPM->Obtain() != 1)
|
if (!IPM || IPM->Obtain() != 1)
|
||||||
{
|
{
|
||||||
dprintf("No performance monitor\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user