mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 00:38:14 +01:00
Rename PUFFS to WUFFS, part 9 of N
This commit is contained in:
1 parent
7fd51d44a2
commit
8e3b5cce5e
6 files changed
+40
-40
No files matched your search
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
// commonflags holds flag defaults and usage messages that are common to the
|
||||
// Puffs command line tools.
|
||||
// Wuffs command line tools.
|
||||
//
|
||||
// It also holds functions to parse and validate these flag values.
|
||||
package commonflags
|
||||
@@ -23,10 +23,10 @@ const (
|
||||
CcompilersUsage = `comma-separated list of C compilers, e.g. "clang,gcc"`
|
||||
|
||||
FocusDefault = ""
|
||||
FocusUsage = `comma-separated list of tests or benchmarks (name prefixes) to focus on, e.g. "puffs_gif_decode"`
|
||||
FocusUsage = `comma-separated list of tests or benchmarks (name prefixes) to focus on, e.g. "wuffs_gif_decode"`
|
||||
|
||||
MimicDefault = false
|
||||
MimicUsage = `whether to compare Puffs' output with other libraries' output`
|
||||
MimicUsage = `whether to compare Wuffs' output with other libraries' output`
|
||||
|
||||
RepsDefault = 5
|
||||
RepsMin = 0
|
||||
|
||||
@@ -103,13 +103,13 @@ func genLib(outDir string, cc string, dynamism string, filenames []string) error
|
||||
args := []string(nil)
|
||||
switch dynamism {
|
||||
case "dynamic":
|
||||
// TODO: add a "-Wl,-soname,libpuffs.so.1.2.3" argument?
|
||||
// TODO: add a "-Wl,-soname,libwuffs.so.1.2.3" argument?
|
||||
args = append(args, "-shared", "-fPIC", "-o")
|
||||
case "static":
|
||||
cc = "ar"
|
||||
args = append(args, "rc")
|
||||
}
|
||||
out := filepath.Join(outDir, "libpuffs"+libExtensions[dynamism])
|
||||
out := filepath.Join(outDir, "libwuffs"+libExtensions[dynamism])
|
||||
args = append(args, out)
|
||||
|
||||
for _, filename := range filenames {
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ func doBenchTest1(filename string, bench bool, ccompilers string, focus string,
|
||||
}
|
||||
ccArgs = append(ccArgs, "-std=c99", "-o", out, in)
|
||||
if mimic {
|
||||
extra, err := findPuffsMimicCflags(in)
|
||||
extra, err := findWuffsMimicCflags(in)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -132,7 +132,7 @@ func doBenchTest1(filename string, bench bool, ccompilers string, focus string,
|
||||
return failed, nil
|
||||
}
|
||||
|
||||
func findPuffsMimicCflags(filename string) ([]string, error) {
|
||||
func findWuffsMimicCflags(filename string) ([]string, error) {
|
||||
f, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// puffsfmt formats Puffs programs.
|
||||
// wuffsfmt formats Wuffs programs.
|
||||
//
|
||||
// Without explicit paths, it rewrites the standard input to standard output.
|
||||
// Otherwise, the -l or -w or both flags must be given. Given a file path, it
|
||||
// operates on that file; given a directory path, it operates on all .puffs
|
||||
// operates on that file; given a directory path, it operates on all .wuffs
|
||||
// files in that directory, recursively. Files starting with a period are
|
||||
// ignored.
|
||||
package main
|
||||
@@ -39,12 +39,12 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
lFlag = flag.Bool("l", false, "list files whose formatting differs from puffsfmt's")
|
||||
lFlag = flag.Bool("l", false, "list files whose formatting differs from wuffsfmt's")
|
||||
wFlag = flag.Bool("w", false, "write result to (source) file instead of stdout")
|
||||
)
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "usage: puffsfmt [flags] [path ...]\n")
|
||||
fmt.Fprintf(os.Stderr, "usage: wuffsfmt [flags] [path ...]\n")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
@@ -90,17 +90,17 @@ func main1() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func isPuffsFile(info os.FileInfo) bool {
|
||||
func isWuffsFile(info os.FileInfo) bool {
|
||||
name := info.Name()
|
||||
return !info.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".puffs")
|
||||
return !info.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".wuffs")
|
||||
}
|
||||
|
||||
func walk(filename string, info os.FileInfo, err error) error {
|
||||
if err == nil && isPuffsFile(info) {
|
||||
if err == nil && isWuffsFile(info) {
|
||||
err = do(nil, filename)
|
||||
}
|
||||
// Don't complain if a file was deleted in the meantime (i.e. the directory
|
||||
// changed concurrently while running puffsfmt).
|
||||
// changed concurrently while running wuffsfmt).
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user