Skip to content

Commit

Permalink
[update] adapt to the latest version of uint-fortran.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinobuAmasaki committed Jan 21, 2024
1 parent 6f5f888 commit edc0fc2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion example/testlibpq2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ program main


use :: libpq
use :: unsigned
use :: unsigned_m
use, intrinsic :: iso_fortran_env, stdout=>output_unit, stderr=>error_unit
use, intrinsic :: iso_c_binding
implicit none
Expand Down
38 changes: 19 additions & 19 deletions src/interfaces/fe-exec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ end function PQexec
function PQexecParams_int32 (conn, command, nParams, paramTypes, paramValues) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m
use :: character_operations_m
implicit none

Expand Down Expand Up @@ -248,7 +248,7 @@ end function PQexecParams_int32
function PQexecParams_int64 (conn, command, nParams, paramTypes, paramValues) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m
use :: character_operations_m
implicit none

Expand Down Expand Up @@ -394,7 +394,7 @@ end function PQexecParams_int64
function PQprepare_int32 (conn, stmtName, query, nParams, paramTypes) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m
implicit none

!*> Submits a request to create a prepared statement with the given parameters, and waits for completion.
Expand Down Expand Up @@ -449,7 +449,7 @@ end function PQprepare_int32
function PQprepare_int64 (conn, stmtName, query, nParams, paramTypes) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m
implicit none

!*> Submits a request to create a prepared statement with the given parameters, and waits for completion.
Expand Down Expand Up @@ -505,7 +505,7 @@ end function PQprepare_int64
function PQprepare_back (conn, stmtName, query, nParams, paramTypes) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m
use :: character_operations_m
implicit none

Expand Down Expand Up @@ -1021,7 +1021,7 @@ end function PQfnumber
function PQftable (pgresult, column_number) result(res)
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env
use :: unsigned
use :: unsigned_m

! 入力
type(c_ptr), intent(in) :: pgresult
Expand All @@ -1048,7 +1048,7 @@ function c_PQ_field_table(pgresult, column_number) bind(c, name="PQftable")
oid = c_PQ_field_table(pgresult, column_number)

! カラムのOidを整数型に変換して結果に格納する。
res = int(oid)
res = cast_to_int64(oid)

!! cf. [PostgreSQL Documentation](https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQFTABLE)
end function PQftable
Expand Down Expand Up @@ -1115,7 +1115,7 @@ end function PQfformat
function PQftype(pgresult, column_number) result(res)
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env
use :: unsigned
use :: unsigned_m

! 入力
type(c_ptr), intent(in) :: pgresult
Expand All @@ -1141,7 +1141,7 @@ end function c_PQ_field_type
oid = c_PQ_field_type(pgresult, column_number)

! カラムのOidを64ビット整数型に変換して結果を格納する。
res = int(oid)
res = cast_to_int64(oid)

!! cf. [PostgreSQL Documentation](https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQFTYPE)
end function PQftype
Expand Down Expand Up @@ -1362,7 +1362,7 @@ end function PQnparams
function PQparamtype(pgresult, param_number) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m

type(c_ptr), intent(in) :: pgresult
integer(int32), intent(in) :: param_number
Expand All @@ -1383,7 +1383,7 @@ end function c_PQ_parameter_type

oid = c_PQ_parameter_type(pgresult, param_number)

res = int(oid)
res = cast_to_int64(oid)

!! cf. [PostgreSQL Documentation](https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQPARAMTYPE)
end function PQparamtype
Expand Down Expand Up @@ -1478,7 +1478,7 @@ end function PQcmdTuples
function PQoidValue(pgresult) result(res)
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env
use :: unsigned
use :: unsigned_m

type(c_ptr), intent(in) :: pgresult
integer(int64) :: res
Expand All @@ -1492,7 +1492,7 @@ function c_PQ_oid_value(pgresult) bind(c, name="PQoidValue")
end function c_PQ_oid_value
end interface

res = int(c_PQ_oid_value(pgresult))
res = cast_to_int64(c_PQ_oid_value(pgresult))

!! cf. [PostgreSQL Documentation](https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQOIDVALUE)
end function PQoidValue
Expand Down Expand Up @@ -1722,7 +1722,7 @@ end function PQsendQuery
function PQsendQueryParams_back (conn, command, nParams, paramTypes, paramValues) result(res)
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env
use :: unsigned
use :: unsigned_m
use :: character_operations_m

! Input parameters
Expand Down Expand Up @@ -1839,7 +1839,7 @@ end function PQsendQueryParams_back
function PQsendQueryParams_int32 (conn, command, nParams, paramTypes, paramValues) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m

type(c_ptr), intent(in) :: conn
character(*), intent(in) :: command
Expand Down Expand Up @@ -1875,7 +1875,7 @@ end function PQsendQueryParams_int32
function PQsendQueryParams_int64 (conn, command, nParams, paramTypes, paramValues) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m

type(c_ptr), intent(in) :: conn
character(*), intent(in) :: command
Expand Down Expand Up @@ -1924,7 +1924,7 @@ end function PQsendQueryParams_int64
function PQsendPrepare_back (conn, stmtName, query, nParams, paramTypes) result(res)
use, intrinsic :: iso_fortran_env
use, intrinsic :: iso_c_binding
use :: unsigned
use :: unsigned_m
use :: character_operations_m
implicit none

Expand Down Expand Up @@ -1980,7 +1980,7 @@ end function PQsendPrepare_back
function PQsendPrepare_int32(conn, stmtName, query, nParams, paramTypes) result(res)
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env
use :: unsigned
use :: unsigned_m
implicit none

type(c_ptr), intent(in) :: conn
Expand Down Expand Up @@ -2017,7 +2017,7 @@ end function PQsendPrepare_int32
function PQsendPrepare_int64(conn, stmtName, query, nParams, paramTypes) result(res)
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env
use :: unsigned
use :: unsigned_m
implicit none

type(c_ptr), intent(in) :: conn
Expand Down

0 comments on commit edc0fc2

Please sign in to comment.