Skip to content

Commit

Permalink
Fix int64_t type translation
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Nov 1, 2022
1 parent 8a5b2b2 commit bcfab61
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
2 changes: 1 addition & 1 deletion header-translator/src/rust_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl RustType {
"uint16_t" => Self::U16,
"int32_t" => Self::I32,
"uint32_t" => Self::U32,
"int164_t" => Self::I64,
"int64_t" => Self::I64,
"uint64_t" => Self::U64,

// MacTypes.h
Expand Down
4 changes: 2 additions & 2 deletions icrate/src/Foundation/generated/NSCoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ extern_methods!(
pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString);

#[method(encodeInt64:forKey:)]
pub unsafe fn encodeInt64_forKey(&self, value: int64_t, key: &NSString);
pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString);

#[method(encodeFloat:forKey:)]
pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString);
Expand Down Expand Up @@ -171,7 +171,7 @@ extern_methods!(
pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32;

#[method(decodeInt64ForKey:)]
pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> int64_t;
pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64;

#[method(decodeFloatForKey:)]
pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float;
Expand Down
4 changes: 2 additions & 2 deletions icrate/src/Foundation/generated/NSKeyedArchiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern_methods!(
pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString);

#[method(encodeInt64:forKey:)]
pub unsafe fn encodeInt64_forKey(&self, value: int64_t, key: &NSString);
pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString);

#[method(encodeFloat:forKey:)]
pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString);
Expand Down Expand Up @@ -212,7 +212,7 @@ extern_methods!(
pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32;

#[method(decodeInt64ForKey:)]
pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> int64_t;
pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64;

#[method(decodeFloatForKey:)]
pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float;
Expand Down
28 changes: 11 additions & 17 deletions icrate/src/Foundation/generated/NSProgress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ extern_methods!(
pub unsafe fn currentProgress() -> Option<Id<NSProgress, Shared>>;

#[method_id(progressWithTotalUnitCount:)]
pub unsafe fn progressWithTotalUnitCount(unitCount: int64_t) -> Id<NSProgress, Shared>;
pub unsafe fn progressWithTotalUnitCount(unitCount: i64) -> Id<NSProgress, Shared>;

#[method_id(discreteProgressWithTotalUnitCount:)]
pub unsafe fn discreteProgressWithTotalUnitCount(
unitCount: int64_t,
) -> Id<NSProgress, Shared>;
pub unsafe fn discreteProgressWithTotalUnitCount(unitCount: i64) -> Id<NSProgress, Shared>;

#[method_id(progressWithTotalUnitCount:parent:pendingUnitCount:)]
pub unsafe fn progressWithTotalUnitCount_parent_pendingUnitCount(
unitCount: int64_t,
unitCount: i64,
parent: &NSProgress,
portionOfParentTotalUnitCount: int64_t,
portionOfParentTotalUnitCount: i64,
) -> Id<NSProgress, Shared>;

#[method_id(initWithParent:userInfo:)]
Expand All @@ -46,36 +44,32 @@ extern_methods!(
) -> Id<Self, Shared>;

#[method(becomeCurrentWithPendingUnitCount:)]
pub unsafe fn becomeCurrentWithPendingUnitCount(&self, unitCount: int64_t);
pub unsafe fn becomeCurrentWithPendingUnitCount(&self, unitCount: i64);

#[method(performAsCurrentWithPendingUnitCount:usingBlock:)]
pub unsafe fn performAsCurrentWithPendingUnitCount_usingBlock(
&self,
unitCount: int64_t,
unitCount: i64,
work: TodoBlock,
);

#[method(resignCurrent)]
pub unsafe fn resignCurrent(&self);

#[method(addChild:withPendingUnitCount:)]
pub unsafe fn addChild_withPendingUnitCount(
&self,
child: &NSProgress,
inUnitCount: int64_t,
);
pub unsafe fn addChild_withPendingUnitCount(&self, child: &NSProgress, inUnitCount: i64);

#[method(totalUnitCount)]
pub unsafe fn totalUnitCount(&self) -> int64_t;
pub unsafe fn totalUnitCount(&self) -> i64;

#[method(setTotalUnitCount:)]
pub unsafe fn setTotalUnitCount(&self, totalUnitCount: int64_t);
pub unsafe fn setTotalUnitCount(&self, totalUnitCount: i64);

#[method(completedUnitCount)]
pub unsafe fn completedUnitCount(&self) -> int64_t;
pub unsafe fn completedUnitCount(&self) -> i64;

#[method(setCompletedUnitCount:)]
pub unsafe fn setCompletedUnitCount(&self, completedUnitCount: int64_t);
pub unsafe fn setCompletedUnitCount(&self, completedUnitCount: i64);

#[method_id(localizedDescription)]
pub unsafe fn localizedDescription(&self) -> Id<NSString, Shared>;
Expand Down
30 changes: 15 additions & 15 deletions icrate/src/Foundation/generated/NSURLSession.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::common::*;
use crate::Foundation::*;

extern "C" {
static NSURLSessionTransferSizeUnknown: int64_t;
static NSURLSessionTransferSizeUnknown: i64;
}

extern_class!(
Expand Down Expand Up @@ -254,34 +254,34 @@ extern_methods!(
pub unsafe fn setEarliestBeginDate(&self, earliestBeginDate: Option<&NSDate>);

#[method(countOfBytesClientExpectsToSend)]
pub unsafe fn countOfBytesClientExpectsToSend(&self) -> int64_t;
pub unsafe fn countOfBytesClientExpectsToSend(&self) -> i64;

#[method(setCountOfBytesClientExpectsToSend:)]
pub unsafe fn setCountOfBytesClientExpectsToSend(
&self,
countOfBytesClientExpectsToSend: int64_t,
countOfBytesClientExpectsToSend: i64,
);

#[method(countOfBytesClientExpectsToReceive)]
pub unsafe fn countOfBytesClientExpectsToReceive(&self) -> int64_t;
pub unsafe fn countOfBytesClientExpectsToReceive(&self) -> i64;

#[method(setCountOfBytesClientExpectsToReceive:)]
pub unsafe fn setCountOfBytesClientExpectsToReceive(
&self,
countOfBytesClientExpectsToReceive: int64_t,
countOfBytesClientExpectsToReceive: i64,
);

#[method(countOfBytesSent)]
pub unsafe fn countOfBytesSent(&self) -> int64_t;
pub unsafe fn countOfBytesSent(&self) -> i64;

#[method(countOfBytesReceived)]
pub unsafe fn countOfBytesReceived(&self) -> int64_t;
pub unsafe fn countOfBytesReceived(&self) -> i64;

#[method(countOfBytesExpectedToSend)]
pub unsafe fn countOfBytesExpectedToSend(&self) -> int64_t;
pub unsafe fn countOfBytesExpectedToSend(&self) -> i64;

#[method(countOfBytesExpectedToReceive)]
pub unsafe fn countOfBytesExpectedToReceive(&self) -> int64_t;
pub unsafe fn countOfBytesExpectedToReceive(&self) -> i64;

#[method_id(taskDescription)]
pub unsafe fn taskDescription(&self) -> Option<Id<NSString, Shared>>;
Expand Down Expand Up @@ -928,22 +928,22 @@ extern_methods!(
pub unsafe fn resourceFetchType(&self) -> NSURLSessionTaskMetricsResourceFetchType;

#[method(countOfRequestHeaderBytesSent)]
pub unsafe fn countOfRequestHeaderBytesSent(&self) -> int64_t;
pub unsafe fn countOfRequestHeaderBytesSent(&self) -> i64;

#[method(countOfRequestBodyBytesSent)]
pub unsafe fn countOfRequestBodyBytesSent(&self) -> int64_t;
pub unsafe fn countOfRequestBodyBytesSent(&self) -> i64;

#[method(countOfRequestBodyBytesBeforeEncoding)]
pub unsafe fn countOfRequestBodyBytesBeforeEncoding(&self) -> int64_t;
pub unsafe fn countOfRequestBodyBytesBeforeEncoding(&self) -> i64;

#[method(countOfResponseHeaderBytesReceived)]
pub unsafe fn countOfResponseHeaderBytesReceived(&self) -> int64_t;
pub unsafe fn countOfResponseHeaderBytesReceived(&self) -> i64;

#[method(countOfResponseBodyBytesReceived)]
pub unsafe fn countOfResponseBodyBytesReceived(&self) -> int64_t;
pub unsafe fn countOfResponseBodyBytesReceived(&self) -> i64;

#[method(countOfResponseBodyBytesAfterDecoding)]
pub unsafe fn countOfResponseBodyBytesAfterDecoding(&self) -> int64_t;
pub unsafe fn countOfResponseBodyBytesAfterDecoding(&self) -> i64;

#[method_id(localAddress)]
pub unsafe fn localAddress(&self) -> Option<Id<NSString, Shared>>;
Expand Down

0 comments on commit bcfab61

Please sign in to comment.