s/ulong/long/g

This commit is contained in:
Doug MacEachern 2005-12-06 17:08:14 +00:00
parent f6aa1fa388
commit b58b47f214
3 changed files with 59 additions and 59 deletions

View File

@ -3,7 +3,7 @@ using Hyperic.Sigar;
public class Df { public class Df {
private static String FormatSize(ulong value) { private static String FormatSize(long value) {
return Sigar.FormatSize(value * 1024); return Sigar.FormatSize(value * 1024);
} }
@ -12,7 +12,7 @@ public class Df {
foreach (FileSystem fs in sigar.FileSystemList()) { foreach (FileSystem fs in sigar.FileSystemList()) {
FileSystemUsage usage; FileSystemUsage usage;
ulong used, avail, total, pct; long used, avail, total, pct;
try { try {
usage = sigar.FileSystemUsage(fs.DirName); usage = sigar.FileSystemUsage(fs.DirName);
@ -20,7 +20,7 @@ public class Df {
used = usage.Total - usage.Free; used = usage.Total - usage.Free;
avail = usage.Avail; avail = usage.Avail;
total = usage.Total; total = usage.Total;
pct = (ulong)(usage.UsePercent * 100); pct = (long)(usage.UsePercent * 100);
} catch (SigarException) { } catch (SigarException) {
used = avail = total = pct = 0; used = avail = total = pct = 0;
continue; continue;

View File

@ -10,7 +10,7 @@ public class Ifconfig {
private static void output(Sigar sigar, String name) { private static void output(Sigar sigar, String name) {
NetInterfaceConfig ifconfig = NetInterfaceConfig ifconfig =
sigar.NetInterfaceConfig(name); sigar.NetInterfaceConfig(name);
ulong flags = ifconfig.Flags; long flags = ifconfig.Flags;
String hwaddr = ""; String hwaddr = "";
if (!Sigar.NULL_HWADDR.Equals(ifconfig.Hwaddr)) { if (!Sigar.NULL_HWADDR.Equals(ifconfig.Hwaddr)) {
@ -61,8 +61,8 @@ public class Ifconfig {
println("\t" + "collisions:" + println("\t" + "collisions:" +
ifstat.TxCollisions); ifstat.TxCollisions);
ulong rxBytes = ifstat.RxBytes; long rxBytes = ifstat.RxBytes;
ulong txBytes = ifstat.TxBytes; long txBytes = ifstat.TxBytes;
println("\t" + println("\t" +
"RX bytes:" + rxBytes + "RX bytes:" + rxBytes +

View File

@ -47,9 +47,9 @@ namespace Hyperic.Sigar {
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern void private static extern void
sigar_format_size(ulong size, StringBuilder buffer); sigar_format_size(long size, StringBuilder buffer);
public static string FormatSize(ulong size) { public static string FormatSize(long size) {
StringBuilder buffer = new StringBuilder(56); StringBuilder buffer = new StringBuilder(56);
sigar_format_size(size, buffer); sigar_format_size(size, buffer);
return buffer.ToString(); return buffer.ToString();
@ -138,13 +138,13 @@ namespace Hyperic.Sigar {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Mem { public struct Mem {
public readonly ulong Ram; public readonly long Ram;
public readonly ulong Total; public readonly long Total;
public readonly ulong Used; public readonly long Used;
public readonly ulong Free; public readonly long Free;
public readonly ulong Shared; public readonly long Shared;
public readonly ulong ActualFree; public readonly long ActualFree;
public readonly ulong ActualUsed; public readonly long ActualUsed;
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern int private static extern int
@ -171,9 +171,9 @@ namespace Hyperic.Sigar {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Swap { public struct Swap {
public readonly ulong Total; public readonly long Total;
public readonly ulong Used; public readonly long Used;
public readonly ulong Free; public readonly long Free;
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern int private static extern int
@ -199,12 +199,12 @@ namespace Hyperic.Sigar {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Cpu { public struct Cpu {
public readonly ulong User; public readonly long User;
public readonly ulong Sys; public readonly long Sys;
private readonly ulong NA_Nice; private readonly long NA_Nice;
public readonly ulong Idle; public readonly long Idle;
private readonly ulong NA_Wait; private readonly long NA_Wait;
public readonly ulong Total; public readonly long Total;
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern int private static extern int
@ -235,7 +235,7 @@ namespace Hyperic.Sigar {
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]
public readonly string Model; //char[128] public readonly string Model; //char[128]
public readonly int Mhz; public readonly int Mhz;
private readonly ulong CacheSize; //XXX not implemented private readonly long CacheSize; //XXX not implemented
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
@ -353,17 +353,17 @@ namespace Hyperic.Sigar {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct FileSystemUsage { public struct FileSystemUsage {
public readonly ulong Total; public readonly long Total;
public readonly ulong Free; public readonly long Free;
public readonly ulong Avail; public readonly long Avail;
public readonly ulong Used; public readonly long Used;
private readonly ulong NA_Files; //XXX not implemented private readonly long NA_Files; //XXX not implemented
private readonly ulong NA_FreeFiles; private readonly long NA_FreeFiles;
private readonly ulong DiskReads; private readonly long DiskReads;
private readonly ulong DiskWrites; private readonly long DiskWrites;
private readonly ulong DiskWriteBytes; private readonly long DiskWriteBytes;
private readonly ulong DiskReadBytes; private readonly long DiskReadBytes;
private readonly ulong DiskQueue; private readonly long DiskQueue;
public readonly double UsePercent; public readonly double UsePercent;
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
@ -447,13 +447,13 @@ namespace Hyperic.Sigar {
public readonly string Hwaddr; //char[64] public readonly string Hwaddr; //char[64]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=64)] [MarshalAs(UnmanagedType.ByValTStr, SizeConst=64)]
public readonly string Type; //char[64] public readonly string Type; //char[64]
private readonly ulong address; private readonly long address;
private readonly ulong destination; private readonly long destination;
private readonly ulong broadcast; private readonly long broadcast;
private readonly ulong netmask; private readonly long netmask;
public readonly ulong Flags; public readonly long Flags;
public readonly ulong Mtu; public readonly long Mtu;
public readonly ulong Metric; public readonly long Metric;
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern int private static extern int
@ -483,10 +483,10 @@ namespace Hyperic.Sigar {
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern int private static extern int
sigar_inet_ntoa(IntPtr sigar, ulong address, sigar_inet_ntoa(IntPtr sigar, long address,
StringBuilder addr_str); StringBuilder addr_str);
private string inet_ntoa(ulong address) { private string inet_ntoa(long address) {
StringBuilder buffer = new StringBuilder(); StringBuilder buffer = new StringBuilder();
buffer.Capacity = (3 * 4 + 3 + 1); buffer.Capacity = (3 * 4 + 3 + 1);
sigar_inet_ntoa(IntPtr.Zero, address, buffer); sigar_inet_ntoa(IntPtr.Zero, address, buffer);
@ -518,7 +518,7 @@ namespace Hyperic.Sigar {
} }
public String FlagsString() { public String FlagsString() {
ulong flags = this.Flags; long flags = this.Flags;
String retval = ""; String retval = "";
if (flags == 0) if (flags == 0)
@ -552,19 +552,19 @@ namespace Hyperic.Sigar {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct NetInterfaceStat { public struct NetInterfaceStat {
public readonly ulong RxPackets; public readonly long RxPackets;
public readonly ulong RxBytes; public readonly long RxBytes;
public readonly ulong RxErrors; public readonly long RxErrors;
public readonly ulong RxDropped; public readonly long RxDropped;
public readonly ulong RxOverruns; public readonly long RxOverruns;
public readonly ulong RxFrame; public readonly long RxFrame;
public readonly ulong TxPackets; public readonly long TxPackets;
public readonly ulong TxBytes; public readonly long TxBytes;
public readonly ulong TxErrors; public readonly long TxErrors;
public readonly ulong TxDropped; public readonly long TxDropped;
public readonly ulong TxOverruns; public readonly long TxOverruns;
public readonly ulong TxCollisions; public readonly long TxCollisions;
public readonly ulong TxCarrier; public readonly long TxCarrier;
[DllImport(Sigar.LIBSIGAR)] [DllImport(Sigar.LIBSIGAR)]
private static extern int private static extern int