Skip to content

Commit

Permalink
fix xcode errors, wanrings, and -W work as intended again
Browse files Browse the repository at this point in the history
  • Loading branch information
kfix committed Nov 29, 2022
1 parent 1c2b43e commit 06c7ab6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
42 changes: 21 additions & 21 deletions src/DDC.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,35 +413,35 @@ bool EDIDTest(io_service_t framebuffer, struct EDID *edid) {
IOI2CRequest request = {};
/*! from https://opensource.apple.com/source/IOGraphics/IOGraphics-513.1/IOGraphicsFamily/IOKit/i2c/IOI2CInterface.h.auto.html
* not in https://developer.apple.com/reference/kernel/1659924-ioi2cinterface.h/ioi2crequest?changes=latest_beta&language=objc
* @struct IOI2CRequest
* @abstract A structure defining an I2C bus transaction.
* @discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus.
* @field __reservedA Set to zero.
* @field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus.
* @field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously.
* @field commFlags Flags that modify the I2C transaction type. The following flags are defined:<br>
* struct IOI2CRequest
* abstract A structure defining an I2C bus transaction.
* discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus.
* field __reservedA Set to zero.
* field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus.
* field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously.
* field commFlags Flags that modify the I2C transaction type. The following flags are defined:<br>
* kIOI2CUseSubAddressCommFlag Transaction includes a subaddress.<br>
* @field minReplyDelay Minimum delay as absolute time between send and reply transactions.
* @field sendAddress I2C address to write.
* @field sendSubAddress I2C subaddress to write.
* @field __reservedB Set to zero.
* @field sendTransactionType The following types of transaction are defined for the send part of the request:<br>
* field minReplyDelay Minimum delay as absolute time between send and reply transactions.
* field sendAddress I2C address to write.
* field sendSubAddress I2C subaddress to write.
* field __reservedB Set to zero.
* field sendTransactionType The following types of transaction are defined for the send part of the request:<br>
* kIOI2CNoTransactionType No send transaction to perform. <br>
* kIOI2CSimpleTransactionType Simple I2C message. <br>
* kIOI2CCombinedTransactionType Combined format I2C R/~W transaction. <br>
* @field sendBuffer Pointer to the send buffer.
* @field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request.
* @field replyAddress I2C Address from which to read.
* @field replySubAddress I2C Address from which to read.
* @field __reservedC Set to zero.
* @field replyTransactionType The following types of transaction are defined for the reply part of the request:<br>
* field sendBuffer Pointer to the send buffer.
* field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request.
* field replyAddress I2C Address from which to read.
* field replySubAddress I2C Address from which to read.
* field __reservedC Set to zero.
* field replyTransactionType The following types of transaction are defined for the reply part of the request:<br>
* kIOI2CNoTransactionType No reply transaction to perform. <br>
* kIOI2CSimpleTransactionType Simple I2C message. <br>
* kIOI2CDDCciReplyTransactionType DDC/ci message (with embedded length). See VESA DDC/ci specification. <br>
* kIOI2CCombinedTransactionType Combined format I2C R/~W transaction. <br>
* @field replyBuffer Pointer to the reply buffer.
* @field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request.
* @field __reservedD Set to zero.
* field replyBuffer Pointer to the reply buffer.
* field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request.
* field __reservedD Set to zero.
*/

UInt8 data[128] = {};
Expand Down
2 changes: 1 addition & 1 deletion src/DDC.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ struct EDID {
UInt8 checksum : 8;
};

long DDCDelayBase;
extern long DDCDelayBase; // nanoseconds
long DDCDelay(io_service_t framebuffer);
bool DDCWrite(io_service_t framebuffer, struct DDCWriteCommand *write);
bool DDCRead(io_service_t framebuffer, struct DDCReadCommand *read);
Expand Down
2 changes: 0 additions & 2 deletions src/ddcctl.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

extern io_service_t CGDisplayIOServicePort(CGDirectDisplayID display) __attribute__((weak_import));

long DDCDelayBase;

NSString *EDIDString(char *string)
{
NSString *temp = [[NSString alloc] initWithBytes:string length:13 encoding:NSASCIIStringEncoding];
Expand Down

0 comments on commit 06c7ab6

Please sign in to comment.