All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: "Alexander E. Patrakov" <patrakov@gmail.com>,
	clemens@ladisch.de, tiwai@suse.de, perex@perex.cz
Cc: alsa-devel@alsa-project.org,
	linux1394-devel@lists.sourceforge.net, ffado-devel@lists.sf.net
Subject: Re: [PATCH 13/13] libhinawa: add sample scripts
Date: Wed, 28 Jan 2015 00:09:18 +0900	[thread overview]
Message-ID: <54C7AA1E.4040900@sakamocchi.jp> (raw)
In-Reply-To: <54C4DE43.1050105@gmail.com>

Hi Alexander,

On Jan 25 2014 21:14, Alexander E. Patrakov wrote:
> 25.01.2015 16:34, Takashi Sakamoto wrote:
>> +from array import array
>> +
>> +# helper function
>> +def get_array():
>> +    # The width with 'L' parameter is depending on environment.
>> +    arr = array('L')
>> +    if arr.itemsize is not 4:
>> +        arr = array('I')
>> +    return arr
> 
> 
> If you insist on using arrays, then please add an assertion that you
> have actually got an array with itemsize 4 at the end.

Thanks for your comment. Certainly, I should put assersion to the
function for guarantee to return 32bit array.

> But, if I were you, I'd go with the "ctypes" module instead, if it
> works. Here is how you get a fixed-size (in the example, 10 elements)
> array with signed 4-byte elements:
> 
> from ctypes import *
> TenInts = c_int32 * 10
> ii = TenInts()
> 
> The result supports buffer protocol.

I didn't realize this way, thank you.

But I'm too lazy to like fixed size of array. With the array module, I
can expand the length of array automatically, like:

{{{
from array import array
arr = array('L')
arr.append(1)
arr.append(2)
...
arr.append("Aaargh, how large number!")
}}}

Do you know the ways for flexible length in ctype array?


Regards

Takashi Sakamoto

  reply	other threads:[~2015-01-27 15:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-25 11:34 [RFC][PATCH 00/13] alsa-tools: libhinawa for control applications of FireWire devices Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 01/13] libhinawa: add build definitions Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 02/13] libhinawa: add hinawa context Takashi Sakamoto
2015-01-27 15:35   ` Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 03/13] libhinawa: support GTK-Doc to generate references Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 04/13] libhinawa: add 'fw_unit' object as a listener for FireWire unit Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 05/13] libhinawa: support GObject Introspection for language bindings Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 06/13] libhinawa: add 'fw_resp' object as a responder for FireWire transaction Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 07/13] libhinawa: add 'fw_req' object as requester " Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 08/13] libhinawa: add 'fw_fcp' object as a helper of FCP transaction Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 09/13] libhinawa: add 'snd_unit' object as a listener for ALSA FireWire devices Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 10/13] libhinawa: add 'snd_dice' object as a helper for Dice notification Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 11/13] libhinawa: add 'snd_efw' object as a helper for EFW transaction Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 12/13] libhinawa: add 'unit_query' as a query for ALSA FireWire devices Takashi Sakamoto
2015-01-25 11:34 ` [PATCH 13/13] libhinawa: add sample scripts Takashi Sakamoto
2015-01-25 12:14   ` [alsa-devel] " Alexander E. Patrakov
2015-01-27 15:09     ` Takashi Sakamoto [this message]
2015-01-27 15:16       ` Alexander E. Patrakov
2015-01-26 23:05 ` [FFADO-devel] [RFC][PATCH 00/13] alsa-tools: libhinawa for control applications of FireWire devices Jonathan Woithe
2015-03-20  9:28 ` Damien Zammit
2015-03-20 10:09   ` [alsa-devel] " Clemens Ladisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C7AA1E.4040900@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sf.net \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=patrakov@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.