Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Dec 25, 2023
1 parent 1643ef7 commit 314063e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/psutil/psutil_posix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ proc net_if_addrs*(): Table[string, seq[Address]] =
let bc_or_ptp = psutil_convert_ipaddr(current.ifu_broadaddr, family)
let broadcast = if (current.ifa_flags and IFF_BROADCAST) !=
0: bc_or_ptp else: ""
# ifu_broadcast and ifu_ptp are a union in C, but we don't really care what C calls it
let ptp = if (current.ifa_flags and IFF_POINTOPOINT) !=
0: bc_or_ptp else: ""
# ifu_broadcast and ifu_ptp are a union in C, but we don't really care what C calls it
let ptp = if (current.ifa_flags and IFF_POINTOPOINT) !=
0: bc_or_ptp else: ""

if not(name in result): result[name] = newSeq[Address]()
if not(name in result): result[name] = newSeq[Address]()
result[name].add(Address(family: family, # psutil_posix.nim(138, 42) Error: type mismatch: got <int32> but expected 'TSa_Family = uint16'
address: address,
netmask: netmask,
Expand Down Expand Up @@ -280,11 +280,10 @@ proc net_if_flags*(name: string): bool =

when bsdPlatform:
{.compile: "arch/bsd_osx.c".}
# import segfaults
import system / ansi_c
import system / ansi_c
proc psutil_get_nic_speed*(ifm_active: cint): cint {.importc: "psutil_get_nic_speed".}

type ifmediareq {.importc: "struct ifmediareq", header: "<net/if.h>",
type ifmediareq {.importc: "struct ifmediareq", header: "<net/if.h>",
nodecl, pure.} = object
ifm_name*: array[IFNAMSIZ, char] # if name, e.g. "en0"
ifm_current: cint # current media options
Expand Down

0 comments on commit 314063e

Please sign in to comment.